In PowerShell, how do I convert DateTime to UNIX time? -
in powershell, how can convert string of datetime sum of seconds?
ps h:\> (new-timespan -start $date1 -end $date2).totalseconds 1289923177.87462
new-timespan can used that. example,
$date1 = get-date -date "01/01/1970" $date2 = get-date (new-timespan -start $date1 -end $date2).totalseconds
Comments
Post a Comment