Alex Rivera | Logout

Find time in milliseconds?

Asked 2012-01-30T06:42:00.370
33

How can I find the time in milliseconds using PowerShell?

Edit
Report

1 Answer

11

In PowerShell you can cast a time value to a timespan and call the TotalMilliseconds method:

([TimeSpan]"00:05:00").TotalMilliseconds # Returns 300000

([TimeSpan] (Get-Date).ToShortTimeString()).TotalMilliseconds # Returns total milliseconds from 00:00:00 till now
answered 2012-01-30T06:58:11.053

Your Answer