Wednesday, December 29, 2010

January 1st 1601

If you use ADSI edit to examine Active Directory time stamps, you will find one big fat integer like this:

129381070675380450

This is actually the number of 100 Nano second periods that have occurred since January 1st 1601. This known as the first Epoch (a 400 year period) and makes the transition from the Julian calendar to the Gregorian calendar. The Gregorian calendar reflects that there is not 365.25 days in a year but actually 365.2421988.

The obvious question is - how do I easily convert this long integer into a real date/time. It's not a simple calculation because of the leap years and the leap minutes & seconds that are used to keep our clocks true. Fortunately Microsoft provides a tool. It’s actually the good ole' W32TM which is also used to configure and monitor time synchronization services in Windows. Here is an example showing the syntax and the result:

w32tm /ntte 129381070675380450

The result, in this case, is:

149746 14:37:47.5380450 - 12/29/2010 7:37:47 AM

Cheers!

No comments:

Post a Comment