M
M
Mad Coder2021-06-17 10:32:09
JavaScript
Mad Coder, 2021-06-17 10:32:09

How to get only Moscow time in moment().isBefore(date)?

I have a date comparison in the following format moment('2021-06-17').isBefore(time received from the server).
But here the time zone is taken into account. And I need the check to go only in Moscow. How to fix it? Thank you all in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2021-06-17
@polyak-y

Use full time with explicit timezone, not date.
moment('2021-06-17T00:00:00+03:00').isBefore(...);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question