使用Powershell中的Get-Date cmdlet正确格式化日期

时间:2017-11-13 12:41:49

标签: powershell datetime

我正在尝试使用以下格式生成时间戳 MESSAGE:Dynamo Insert record failed. The error received was NoSuchElementException. Message arrived on: myTopic/data, Action: dynamo, Table: myTable, HashKeyField: topic, HashKeyValue: , RangeKeyField: Some(timestamp), RangeKeyValue:

使用2017-11-11T19:33:27,我可以生成Get-Date -Format o

如何在生成的输出中删除毫秒2017-11-13T07:39:32.7958466-05:00

1 个答案:

答案 0 :(得分:3)

使用Get-Date -Format s代替Get-Date -Format o

Formatting Dates and Times

相关问题