Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Moment.js supports timezones.
Either pass the time in the form of unix seconds, and on the client side already format and display in the local time zone.
You can use moment, as the author of the answer above mentioned, but not everything is smooth there either. Here you can see an example of usage: https://repl.it/@Melodyn/momentJS
In general, working with UTC offset in Moment is not much different from the same in Date. Just use the date in ISO format and append the tail:
new Date('2019-09-24T12:00:00+0000') // время по UTC
new Date('2019-09-24T12:00:00+0300') // время по Москве
new Date('2019-09-24T12:00:00+0300') // время по Москве
new Date('2019-09-24T12:00:00+0600') // время по вашем региону
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question