PowerShell – Convert Ticks to Time

powershell

Converting dates/times into ticks using the PowerShell Get-Date applet is simple. However, how do you do the opposite operation; converting the ticks back into a date and time?

Best Solution

[DateTime]10000000000
Monday, January 01, 0001 12:16:40 AM

Just cast the number into a DateTime. The DateTime single-parameter constructor takes a long as number of ticks.