PowerShell中iso8601格式日期和DateTime對象互轉實例
阿新 • • 發佈:2018-07-12
-m ng- 日期 parse lob see form yun mes 參考鏈接:
https://technet.microsoft.com/zh-cn/library/aa997624(v=exchg.150).aspx
https://www.pstips.net/convert-iso8601-date-string-to-date-object.html
https://www.pstips.net/convert-datetime-to-iso8601-format.html
https://segmentfault.com/a/1190000004292140
https://edu.aliyun.com/a/9853?spm=5176.11310711.0.0.YrSQfd #$now=Get-Date
#$now.ToString(‘yyyy-MM-ddTHH:mm:ss.fffZ‘)
https://technet.microsoft.com/zh-cn/library/aa997624(v=exchg.150).aspx
https://www.pstips.net/convert-iso8601-date-string-to-date-object.html
https://www.pstips.net/convert-datetime-to-iso8601-format.html
https://segmentfault.com/a/1190000004292140
https://edu.aliyun.com/a/9853?spm=5176.11310711.0.0.YrSQfd
Powershell將日期時間轉換成iso8601格式
#$now.ToString(‘yyyy-MM-ddTHH:mm:ss.fffZ‘)
Powershell將iso8601格式的日期字符串轉換成DateTime對象
#$dateTimeStr = ‘2018-07-10T13:49:38.532Z‘
#$format = ‘yyyy-MM-ddTHH:mm:ss.fffZ‘
#$formatProvider = [Globalization.CultureInfo]::InvariantCulture
#[datetime]::ParseExact($dateTimeStr,$format,$formatProvider)
註:執行的時候請刪除#
PowerShell中iso8601格式日期和DateTime對象互轉實例