To create relative dates like "10 days ago," there are two paths. Administrators often add or remove time spans created by New-Timespan:
(Get-Date) - (New-TimeSpan -days 10)
Developers prefer object methods:
(Get-Date).AddDays(-10)
Both approaches will yield you the same result.
ReTweet this Tip!
Posted
Jun 11 2010, 08:00 AM
by
ps1