Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

We hit this with the US timezone change in 2005. The front-end devs were using moment.js which didn't know about the previous start/end dates.

These days I try to encode everything that is logically a date as yyyy-mm-dd. And if I need to do math with it, I often work with an offset julian date as an integer. But that only works if you stay on this side of September 1752:

    % cal 09 1752
       September 1752     
    Su Mo Tu We Th Fr Sa  
           1  2 14 15 16  
    17 18 19 20 21 22 23  
    24 25 26 27 28 29 30


Before roughly 100 years ago, calendar dates were region-dependent anyway (Russia was still on the Julian calendar until 1918), and time zones didn’t really exist until roughly 150 years ago (their establishment mostly being motivated by the spreading of railways). It’s okay to apply the perpetual Gregorian calendar both into the past and the future by default. It probably won’t last more than a couple thousand years into the future as well, considering Earth’s decelerating rotation.


I think time zones not existing really meant there were infinite time zones, because you use the sun to tell the time.


The solar day varies in length by more than a minute over the year. That doesn't correspond to a well-defined time zone. Also, "zone" implies a geographical area, which meridians arguably aren't.


Some Orthodox Churches still use the Julian calendar even today. Of course they aren't major software customers.


If you're truly using Julian dates, the switch to the Gregorian calendar in the UK and US in September 1752 shouldn't affect you.


> if I need to do math with it, I often work with an offset julian date as an integer. But that only works if you stay on this side of September 1752

Wouldn't using Julian days prevent the ordinary problems involved with doing calendar math across a renumbering of the dates?


The mapping from year, month, day that I use (based on the Wikipedia page, but starting on march 1, 1600) doesn't take that gap into account. So the days in that gap exist for me, but we don't deal with dates that far back.


oof, there went 12 days. at least this isn't a regular occurrence outside of 1752 (unless you have DID, I guess)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: