PowerShell - 将刻度转换为时间

mkC*_*ark 10 powershell

使用PowerShell Get-Date小程序将日期/时间转换为刻度线非常简单.但是,你怎么做相反的操作; 将刻度转换回日期和时间?

Lee*_*Lee 18

[DateTime]10000000000
Monday, January 01, 0001 12:16:40 AM
Run Code Online (Sandbox Code Playgroud)

只需将数字转换成一个DateTime.的DateTime单参数构造函数采用long如蜱数.


Joe*_*oey 5

请注意,您也可以使用Get-Datecmdlet 执行相反的操作:

PS> Get-Date 634141193308872671

Mittwoch, 7. Juli 2010 17:08:50
Run Code Online (Sandbox Code Playgroud)