//
// Load the time field elements into local variables. This should
// ensure that the compiler will only load the input elements
// once, even if there are alias problems. It will also make
// everything (except the year) zero based. We cannot zero base the
// year because then we can't recognize cases where we're given a year
// before 1601.
//
Year = TimeFields->Year;
Month = TimeFields->Month - 1;
Day = TimeFields->Day - 1;
Hour = TimeFields->Hour;
Minute = TimeFields->Minute;
Second = TimeFields->Second;
Milliseconds = TimeFields->Milliseconds;
//
// Check that the time field input variable contains
// proper values.
//
//
// Year 30827 check: Time (in 100ns units) is stored in a
// 64-bit integer, rooted at 1/1/1601.
//
// 2^63 / (10^7 * 86400) = 10675199 days
// 10675199 / 146097 = 73 400-year chunks, 10118 days
// 10118 / 1461 = 6 4-year chunks, 1352 days
// 1352 / 365 = 3 years, some residual days
// 1600 + 73*400 + 6*4 + 3 = 30827 is last year fully
// supported.
//
// I'm guessing it's undesirable to support part of the
// year 30828.
//