PowerShell: Comparing dates -
i querying data source dates. depending on item searching for, may have more date associated it.
get-date ($output | select-object -expandproperty "date") an example of output looks like:
monday, april 08, 2013 12:00:00 friday, april 08, 2011 12:00:00 i compare these dates , return 1 set further out future.
as get-date returns datetime object able compare them directly. example:
(get-date 2010-01-02) -lt (get-date 2010-01-01) will return false.
Comments
Post a Comment