Instance MethodFoundationEssentials
timeZone(separator:)
iOS 15.0+
iPadOS 15.0+
Mac Catalyst 15.0+
macOS 12.0+
tvOS 15.0+
watchOS 8.0+
Modifies the ISO 8601 date format style to include the time zone in the formatted output.
func timeZone(separator: Date.ISO8601FormatStyle.TimeZoneSeparator) -> Date.ISO8601FormatStyle
Parameters
separatorThe character used to separate the time and time zone in a date.
Return Value
An ISO 8601 date format style modified to include the time zone.
Discussion
The default Date.ISO8601FormatStyle doesn’t include the time zone.