Convert Unix time with PowerShell

后端 未结 7 1916
南方客
南方客 2020-11-28 14:58

I am parsing an SQLite database using the PowerShell SQLite module, and a couple of the return values are created and modified, both of which are in Unix time.

What

7条回答
  •  温柔的废话
    2020-11-28 15:48

    A simple one-liner:

    (Get-Date "1970-01-01 00:00:00.000Z") + ([TimeSpan]::FromSeconds($unixTime))
    

提交回复
热议问题