[AFS3-std] Re: A call for consensus on draft-deason-afs3-type-time-02

Russ Allbery rra@stanford.edu
Mon, 01 Aug 2011 14:16:18 -0700


Jeffrey Altman <jaltman@secure-endpoints.com> writes:

> If you can provide me a list of boundary times to check I can construct
> a test application that uses SYSTEMTIME to FILETIME conversions to test
> the results of various time arithmetic operations.

> typedef struct _SYSTEMTIME {
>   WORD wYear;
>   WORD wMonth;
>   WORD wDayOfWeek;
>   WORD wDay;
>   WORD wHour;
>   WORD wMinute;
>   WORD wSecond;
>   WORD wMilliseconds;
> } SYSTEMTIME, *PSYSTEMTIME;

Usually the interesting ones for Gregorian conversion of software written
in the US are around the date of UK transition from Julian to Gregorian in
September of 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

(gcal is one of the few programs I know that attempts to cope with this.)

My guess is that Windows is using a backwards-projection of UTC without
leap seconds and not attempting to worry about dates that theoretically
should be in Julian, so you'll get an offset of 10 or 11 days relative to
the actual historical time when converting from a timestamp to calendar
time.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>