Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
116
rated 0 times [  118] [ 2]  / answers: 1 / hits: 8326  / 3 Years ago, wed, november 17, 2021, 12:00:00

When I try this new Date('2015-01-25T17:00:00.000Z') it will returning the next date Jan 26 2015 00:00:00, this is an expected behaviour for me, but why it is like this?


Is there any explanation from this js behaviour when using TZ with value of OO:OO:OO.


More From » date

 Answers
3

The Z at the very end means "Zulu Time" which is another word for UTC.


The result you see in your console is the time in your current timezone. You are probably 5 hours ahead of UTC.


If you remove the Z, the output you get is the same as what you put in, because Javascript will use local time by default.


[#674] Saturday, November 6, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tierney

Total Points: 45
Total Questions: 101
Total Answers: 94

Location: Sudan
Member since Thu, May 7, 2020
4 Years ago
;