Where are the 34 minutes and 8 seconds coming from?

Viewed 63

If I enter

new Date('0001-01-01T00:00:00.0000000Z')

into Chrome's console, the output is

Date Mon Jan 01 0001 00:34:08 GMT+0034 (Mitteleuropäische Normalzeit)

Where are the 34:08 minutes coming from? How can I circumvent this?

I'm asking this because to specify "an unknown date long ago", our application writes 01/01/0001 into the database, which shows up as 01/01/0001 00:34 in the UI, which is of course slightly disturbing.

Don't tell me not to use "magic numbers" for things like this, I didn't write the application...

1 Answers

Weirdly I was just reading about local time discontinuities last night in this post: https://stackoverflow.com/a/6841479/1772933

Without being able to pinpoint exactly why you're getting 34 minutes, there have been numerous time adjustments (not including daylight savings etc), like this 0:5:52 rollback in Shanghai, 1927: https://www.timeanddate.com/time/change/china/shanghai?year=1927 - nor was that the only one over the last 2 centuries, probably done in the interest of global standardization.

I believe the accumulation of these odd time adjustments might be the reason you're seeing this anomaly in your 0001 year, though I thought this was a locale issue and working in UTC would circumvent it.

Related