gpt4 book ai didi

Windows ISO 8601 时间戳

转载 作者:可可西里 更新时间:2023-11-01 12:36:45 25 4
gpt4 key购买 nike

我需要将 Windows PowerShell 中的日期转换为 ISO 8601 格式。

在 Linux/Unix 下没问题

TZ=0 date -d "<random-format>" +%Y-%m-%dT%H:%M:%S.000Z

现在我需要在 Windows PowerShell 中执行相同的操作。 Windows 上的输出格式为

Wednesday, 19. July 2017 01:06:13

我该怎么做?

最佳答案

PowerShell 的 Get-Date支持标准的.NET 时间格式。 o round-trip格式符合 ISO 8601。像这样,

Get-Date -Format "o"

2017-08-15T12:10:34.4443084+03:00

关于Windows ISO 8601 时间戳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45689471/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com