PowerShell Get-Date UTC: Get, Format and Convert UTC Time
Need the current time in UTC? In PowerShell 7.1 and later, Get-Date -AsUTC returns it directly. Windows PowerShell 5.1 doesn’t have that switch, so use [datetime]::UtcNow there, which works in every version: Both return a DateTime whose Kind is Utc. Below I’ll format UTC values, convert them to and from US time zones, parse UTC … Read more