QuickTip: How long since a file was last written to?

April 18, 2010

no comments

Here’s a quick way to find out. Pipe the file to the New-TimeSpan cmdlet.

PS > Get-ChildItem foo.txt | New-TimeSpan

Days : 319
Hours : 7
Minutes : 8
Seconds : 48
Milliseconds : 409
Ticks : 275873284097833
TotalDays : 319.29778252064
TotalHours : 7663.14678049536
TotalMinutes : 459788.806829722
TotalSeconds : 27587328.4097833
TotalMilliseconds : 27587328409.7833
Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*