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

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -