PowerShell Get-Date Format ISO 8601 (o, s, u, UTC and Parsing)

To format a date as ISO 8601 in PowerShell, use Get-Date with the round-trip format specifier o. It returns a string with the date, the time to seven decimal places and the UTC offset:

Get-Date -Format o

On a PC set to Eastern time, that looks like 2026-10-26T09:30:15.2500000-04:00. Use Get-Date -Format s for a shorter stamp without fractions or offset.

In this tutorial, I’ll show you every way to produce a PowerShell Get-Date format ISO 8601 string, from UTC timestamps with a Z to ISO week numbers, and how to parse those strings back into dates.

ISO 8601 formats built into Get-Date: o, s and u

ISO 8601 is the international date standard: year first, then month, day, a T, and the time, such as 2026-10-26T09:30:15. Because the parts run from largest to smallest, the strings sort correctly as plain text.

.NET gives Get-Date three standard format specifiers that follow it. I used a fixed meeting time in New York so the output doesn’t depend on the clock or time zone of the PC running it:

$eastern = [TimeZoneInfo]::FindSystemTimeZoneById('Eastern Standard Time')
$utc     = [datetime]::new(2026, 10, 26, 13, 30, 15, 250, [DateTimeKind]::Utc)
$nyc     = [TimeZoneInfo]::ConvertTime([datetimeoffset]$utc, $eastern)

"o  $($nyc.ToString('o'))"
"o  $(Get-Date -Date $utc -Format o)"
"s  $(Get-Date -Date $nyc.DateTime -Format s)"
"u  $(Get-Date -Date $utc -Format u)"

Output:

o  2026-10-26T09:30:15.2500000-04:00
o  2026-10-26T13:30:15.2500000Z
s  2026-10-26T09:30:15
u  2026-10-26 13:30:15Z
PowerShell Get-Date ISO 8601 output with the o, s and u format specifiers
The round-trip o, sortable s and universal sortable u formats for one Eastern time (PowerShell 7)

The first line is o on a DateTimeOffset, which carries the -04:00 Eastern daylight offset. The second is o on a UTC date, so the offset becomes Z, short for zero offset.

s drops the fractions and the zone. u ends in Z but uses a space instead of the T, so it’s ISO-like rather than strict ISO 8601. For every other pattern, see the full guide to formatting dates in PowerShell.

Keep in mind that -Format returns a string, not a DateTime. Do any date math first and format last.

What does the o format show for UTC, local and unspecified dates?

The o format changes its ending based on the Kind of the date. Kind is a DateTime property that says whether the value is UTC, local PC time, or neither (Unspecified):

$utc   = [datetime]::new(2026, 10, 26, 13, 30, 15, 250, [DateTimeKind]::Utc)
$plain = [datetime]::new(2026, 10, 26, 9, 30, 15, 250)
$nyc   = [datetimeoffset]::new($plain, [timespan]::FromHours(-4))

'{0,-15} {1}' -f "$($utc.Kind)", (Get-Date -Date $utc -Format o)
'{0,-15} {1}' -f "$($plain.Kind)", (Get-Date -Date $plain -Format o)
'{0,-15} {1}' -f 'DateTimeOffset', $nyc.ToString('o')

Output:

Utc             2026-10-26T13:30:15.2500000Z
Unspecified     2026-10-26T09:30:15.2500000
DateTimeOffset  2026-10-26T09:30:15.2500000-04:00

UTC dates end in Z, and DateTimeOffset values always show their own offset. A date built from numbers without a Kind is Unspecified, so o prints no zone at all, and the reader can’t tell where that time came from.

Plain Get-Date returns a Local date, which o writes with your PC’s current offset, like -04:00 or -07:00. File timestamps work the same way when you get a file’s modified date