How to convert date/time attributes in Active Directory to standard time format
Vai al contenuto principale
How Can We Help?
Summary
The Active Directory stores date/time values as the number of 100-nanosecond intervals that have elapsed since the 0 hour on January 1, 1601 until the date/time that is being stored. The time is always stored in Greenwich Mean Time (GMT) in the Active Directory. Some examples of Active Directory attributes that store date/time values are LastLogon, LastLogonTimestamp, and LastPwdSet. In order to obtain the date/time value stored in these attributes into a standard format, some conversion is required. This article describes how this conversion can be done.
Procedure
- Obtain the value of the Active Directory attribute that you want to convert. There are many ways to extract values of Active Directory attributes. Using ADSI Edit is one method.
- Open the Command Prompt.
- Type the following command:
w32tm.exe /ntte [time in Windows NT time format] - The date/time value is converted to local time and displayed.
Example
C:\>w32tm.exe /ntte 155520000000000 –> 180 00:00:00.0000000 – 30/06/1601 02:00:00 –> formato gg HH:MM:SS:oooooo
