我可以使用以下内容将日期附加到文本中:
"Foo {0:G} Foo" -f (date) #returns "Foo 2009-12-07 15:34:16 Foo"
但我想要 Unix 格式的时间。
我可以通过
date -UFormat %s
得到它,但我可以使用相同的语法吗?当我使用
-UFormat %s
我得到 1260199855,65625,如何去掉小数点?
最佳答案
[int](Get-Date -UFormat %s -Millisecond 0)
关于powershell - 使用 UFormat 获取 unix 时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1860344/