Why is the Win32 epoch January 1, 1601?


Public Service Announcement: This weekend marks the start of Daylight Saving Time in most parts of the United States.

The FILETIME structure records time in the form of 100-nanosecond intervals since January 1, 1601. Why was that date chosen?

The Gregorian calendar operates on a 400-year cycle, and 1601 is the first year of the cycle that was active at the time Windows NT was being designed. In other words, it was chosen to make the math come out nicely.

I actually have the email from Dave Cutler confirming this.

Comments (41)
  1. John says:

    He should have made the resolution 101-nanosecond intervals just to piss everyone off.

  2. Brian says:

    What a tease.  You tell us you have the email, but then you don’t post it :-(

  3. Maurits says:

    Unfortunatly this means that all the Win32 times between January 1 1601 and September 14th 1752 are twelve days off.

    [Or even later for some other countries. Then again, UTC wasn’t invented until the 20th Century, so all times are off, too. -Raymond]
  4. MJH says:

    1752 only has relevance to the UK and the rest of the British Empire as was at that point.

    Roman Catholic Europe had pretty much entirely adopted the Gregorian Calendar by 1601, and most of protestant Europe (other then the UK) by 1700. Eastern Orthodox European countries generally left it until post WWI.

    That’s all largely besides the point though, correctly implementing regional specific calendars, including for past dates, has nothing really to do with when you set your Epoch, the same maths will be done for negative dates as for positive dates.

  5. DWalker59 says:

    @MJH: You mean "beside the point", not "besides the point".  My ex used to say the same thing and it drove me crazy.

  6. Happily Married says:

    @DWalker59: If that drove you crazy, its no wonder she’s your ex!

  7. Karellen says:

    Strike one against the "NT is just VMS because Dave Cutler happened to work on them both" conspiracy theorists, as VMS’ epoch is November 17, 1858[0]

    [0] http://en.wikipedia.org/wiki/Epoch_(reference_date)#Notable_epoch_dates_in_computing

  8. Neil says:

    Since the cycles will eventually trip over the lack of a 29 Feb 4000, wouldn’t it have been better to start on 1 Mar 1600? Perhaps more realistically it should have started in 1 BC (or 0 in the astronomical proleptic calendar), which would then make the maths for AD 4000 easier.

  9. Alexandre Grigoriev says:

    Neil,

    They’ll have to deep-freeze Raymond, then, to resolve the dreaded Y4K Windows crash… It could be as bad as leap year Zune crash.

  10. someone else says:

    And you already are a reference on Wikipedia.

  11. Unhappily non-married says:

    @Happily Married: After having been driven crazy by someone, shouldn’t you end up being crazy about her, rather than divorced?

  12. Theo Winters says:

    Maurits, if you can find a file that was created before September 14th 1752 I think you should get a nobel prize.

  13. Neil: The Gregorian calendar runs on strict 400-year cycles from now till eternity. In the Gregorian calendar, the year 4000 IS a leap year (because evenly divisible with 400); there will be nothing to trip over.

  14. Old Man Time says:

    @Maurits:

    Actually (in the British Empires) all Win32 times between January 1 1601 and February 28 1700 are 10 days off and all Win32 times between March 1 1700 and September 13th 1752 are 11 days off.

  15. Robert S. Morris says:

    @DWalker59: (not to go too off-topic, but…) You should consult a source such as the OED or Merriam-Webster’s Dictionary of English Usage (in my edition, it’s on pp. 177-78) to see how ‘beside’ and ‘besides’ are being and have been used in English, and I think you’ll find that the comment you are criticizing is, in fact, acceptable.

    (Not that I believe you need to consult some authority to say that someone’s grammatical construction is "correct," but that’s another story. Sorry, I’m a linguist. :))

  16. Worf says:

    Might as well also mention that most of ua north of the border also have the "super happy fun time" of also losing and hour’s sleep and waking up an hour early for the next 7 months.

  17. Joseph Koss says:

    Doesn’t 100ns seem rather odd?

    You would expect 1ms, 1us, or 1ns..

    Whats the history on 100ns? Is that some legacy timing chips 10mhz frequency bleeding through?

  18. Anonymous Coward says:

    If I recall correctly, the BIOS clock ticks at 10 MHz.

  19. Ken Hagan says:

    If you want the maths to work nicely, 1st March 2000 works quite well and the non-obviousness of the epoch gives the documentation an excuse to elaborate on leap-year rules (heaven knows some folks needed to learn this in the 1990s) and code sequences for predicting leap years and computing intervals (which are, in fact, substantially simpler with this epoch).

  20. David says:

    "This weekend marks the start of Daylight Saving Time in most parts of the United States."

    Actually it marks the END of Daylight Saving Time.

  21. Davepl says:

    I grew up in Saskatchewan, which does not observe daily savings time.  Bruned into my memory is a radio talk show where they were debating the issue, and a farmer called into advocate NOT observing it like (most of) the rest of North America.

    Why?

    We don’t another hour of sunshine, the crops are dry enough already!

  22. GregM says:

    "This weekend marks the start of Daylight Saving Time in most parts of the United States."

    "Actually it marks the END of Daylight Saving Time."

    David, we are currently in standard time, and we will be entering saving time.  Therefore, this weekend marks the start.

  23. someone else says:

    IIRC, Saskatchewan is on *permanent* DST (i. e. one timezone east of which it should be).

  24. Alexandre Grigoriev says:

    "If I recall correctly, the BIOS clock ticks at 10 MHz"

    You wish. Because of its legacy, the clock source is 4 times NTSC color subcarrier frequency. Divided by 12, it’s used as the interval timer source.

  25. Aaargh! says:

    Any specific reason not to choose 1/1/1970 like the rest of the world ?

  26. KJK::Hyperion says:

    It also happens to be the same epoch used by COBOL, for some reason

  27. bla says:

    Any specific reason not to choose 1/1/1970 like the rest of the world ?

    Unix is not the rest of the world.

    It’s just another participant.

  28. laonianren says:

    "In other words, it was chosen to make the math come out nicely."

    I noticed this years ago when I had to write some code to convert win32 dates to some other format: using 1601 as the epoch saves a single addition operation.  Woohoo!

  29. Ian Johns says:

    See http://www.timeanddate.com/worldclock/ for listings of which major cities are in Daylight Saving Time, or as it also refers to it as "summer time".

    Now that US & Canada expanded their Daylight Saving time by a month earlier & later, there are several weeks in spring & fall now where US & Canada time zones are in Daylight Saving at the same time as cities & countries in the southern hemisphere.

    For example, right now Auckland, New Zealand & Sydney, Australia are still in Daylight Saving at the same time that US & Canada are just starting Daylight Saving.  I think this overlap might last for a few weeks whereas I don’t believe it overlapped as long with the previous US/Canada DST schedule.

  30. Joe Butler says:

    Did anyone enjoy the Windows 95 experience when the clock was automatically put back an hour at Winter?  

    Windows has adjusted your clock [and it is now 1am].  And then an hour later on… Windows has adjusted your clock [and it is now 1am].

    I can just see the programmer of that feature adjusting his clock to 0159 and waiting… "Yeah, that seems to work."

  31. dapanther says:

    @Theo Winters – What if I have database entries older then 9/14/1752? I have a few of these, would that qualify for a Nobel prize hehe..

  32. Dave says:

    Wow, this post really did bring out all the pedants out of the woodwork.

  33. old skool says:

    Why can’t anyone invent a computerized calendar which starts at year zero? I know "zear zero" doesn’t exist, and dates would become shifted, but one could compensate for this in the same manner one needs to compensate for any older date than 1752. With a zero based date EVERYTHING would be so much more easier. And faster. It doesn’t take a genius to think this stuff up. Any kid could do it. No, instead several other calendars are invented to no use. First DOS filedate, then Windows filedate, then other kind of dates. sigh.

  34. 640k says:

    Microsoft invented this calendar because it’s enough for the USA timeframe. Older contries (<1601) are therefore still forced to struggle with date conversion. It would have been to obvious to set "year 0" to 1776.

  35. 1980 says:

    Why doesn’t explorer show/sort file dates before 1980?

  36. bla says:

    Microsoft invented this calendar because it’s enough for the USA timeframe. Older contries (<1601) are therefore still forced to struggle with date conversion. It would have been to obvious to set "year 0" to 1776.

    Yes, the Spanish are really struggling with their files from 1492.

    Why can’t anyone invent a computerized calendar which starts at year zero?

    Why not use unlimited dates? There may be files we want to date thousands of years into the past. And don’t forget those files alien civilizations may create on our machines, when they find the ruins of our civilization!

    /sarcasm

    What is wrong with your reading comprehension skills?

  37. Joe Butler says:

    old skool and 640k – you might be interested to know that Raymond has answered your questions in the following post:

    http://blogs.msdn.com/oldnewthing/archive/2009/03/06/9461176.aspx

  38. porter says:

    > Why can’t anyone invent a computerized calendar which starts at year zero?

    Because there would be a fundamental disagreement over whether we were currently in year 13,610,000,000, 4,500,000,000 or 6,000.

  39. cg says:

    @Old Man Time and Maurits – none of the dates are really "off" by any amount. The calendar in Windows is the proleptic Gregorian calendar – where the Gregorian algorithm is used for all dates – even those dates before the calendar was actually adopted. The calendar in use earlier than that was the Julian Calendar.

  40. John Muller says:

    I was working support for a consumer database product (no, not Access), and a user was having problems with the database feature not correctly storing dates.

    Seems she was entering data from old tombstones, some of which had dates prior to 1900.

Comments are closed.