我正在嘗試使用 powershell 將包含 RFC 2822 格式日期的字串轉換為另一種格式。現在我收到一個錯誤,說我的字串未被識別為有效的 DateTime。
Write-Host ([Datetime]::ParseExact('Thu Oct 07 09:23:26 UTC 2021', '[R][1]', $null)).ToString("yyyyMMdd")
我不確定我做錯了什么。
uj5u.com熱心網友回復:
該R標準的DATETIME格式字串說明并沒有描述您提供的格式。
您將需要一個自定義格式字串:
[Datetime]::ParseExact('Thu Oct 07 09:23:26 UTC 2021', 'ddd MMM dd HH:mm:ss UTC yyyy', $null)
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/316411.html
標籤:电源外壳
