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

Popular posts from this blog

SAP Web Service from .NET via WCF -

Optimized Line drawing in QT -

datetime - str to time in python -