Lyn.Do
Lyn.Do

Reputation: 21

Return wrong date in moment js with full format "DD-MM-YYYYTHH:mm:SSZ"?

I'm using momentjs to convert String to date in with full value of date and time and the result always increases about 12 hours. just like the picture below. enter image description here

So how come does it go like this and how I can do to solve the problem. Many thanks.

Upvotes: 0

Views: 96

Answers (1)

Palethorn
Palethorn

Reputation: 379

"Z" at the end indicates that the date is provided with UTC-0 zone. momentjs internally shifts the timezone to suit your own. You should omit it if you want to reformat provided datetime string.

Upvotes: 2

Related Questions