How To Convert Active Directory TimeStamp Property To DateTime
Maybe your like
Have you ever seen the timestamp format like this and wondered how it’s equivalent to the normal DateTime format?

It’s the date/time value stored in Active Directory as the number of 100-nanosecond intervals that have elapsed since the 0 hours on January 1, 1601, until the date/time that is being stored. It’s always in UTC (Coordinated Universal Time, aka. GMT) and is often used in Properties like LastLogonTimeStamp, LastPwdSet, etc. /via Technet/
The formula that can be used in Excel is something like this:
DateTime (UTC) = Timestamp/(8.64*10^11) - 109205
You can also use w32tm command line to do the quick conversion as well.
w32tm /ntte timestamp-value
The time shown in the second half is for local time in PCT.
Now let’s take look how it converts in PowerShell, which is so easy.
To convert a timestamp to DateTime format in UTC.
[DateTime]::FromFileTimeUtc(TimeStamp-value)
Local time, regardless of where you are?
[DateTime]::FromFileTime(TimeStamp-value)
Well, that’s one hour off, comparing to using the W32TM command, blame on the summer time saving.
You can also do the conversion the other way around, getting the timestamp from a specified date/time value. For example, to get the present moment in TimeStamp,
(Get-Date).ToFileTime()
Hope it helps.
Related
Post navigation
Renewing SSL Certificate on Remote Desktop Gateway ServerHow To Get the Full List of Properties of A PowerShell ObjectOne thought on “How To Convert Active Directory TimeStamp Property to DateTime”
-
Thank you, a great help! 🙂
Reply
Leave a Reply Cancel reply
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Website
Notify me of follow-up comments by email.
Notify me of new posts by email.
Search for:- Group Policy to Bypass the UAC Prompt After PrinterNightmare Patch
- Managing Microsoft Licenses in PowerShell and Microsoft Graph
- Audit Email Deletion in Microsoft 365
- Adding Multiple Server Names to A Windows Server
- Enforcing HTTP to HTTPS on IIS
KC's Blog
Tag » Active Directory Pwdlastset Convert To Date Powershell
-
Get-AdUser PwdLastSet - Get Aduser Last Password Change
-
Efficiently Converting Pwdlastset To Datetime In A Single Line.
-
Converting Pwdlastset To Datetime Datatype Not Working From Hash ...
-
Powershell Output Of Ad-user PwdLastSet And LastLoginTimeStamp
-
PowerShell Code: Convert Integer8 To Date - Active Directory Security
-
TIP: Active Directory Module Date Properties - Tech Wizard
-
Powershell: How Do I Query PwdLastSet And Have It Make Sense?
-
Convert Int64 TimeStamp To DateTime In Powershell
-
LDAP, Active Directory & Filetime Timestamp Converter
-
Active Directory Powershell: Quick Tip LastLogonTimeStamp And ...
-
Powershell Script - Users Pwdlastset - Spiceworks Community
-
Finding Users Who Have Not Changed Their Password Recently
-
How To Find Last Password Change Date With Or Without PowerShell
-
Integer8 Attributes