Type Method_StringProcessing
iso8601ComponentsWithTimeZone(includingFractionalSeconds:dateSeparator:dateTimeSeparator:timeSeparator:timeZoneSeparator:)
iOS 26.0+
iPadOS 26.0+
Mac Catalyst 26.0+
macOS 26.0+
tvOS 26.0+
visionOS 26.0+
watchOS 26.0+
Creates a regex component to match an ISO 8601 date and time string, including time zone, and capture the string as a
DateComponents using the time zone as specified in the string.static func iso8601ComponentsWithTimeZone(includingFractionalSeconds: Bool = false, dateSeparator: Date.ISO8601FormatStyle.DateSeparator = .dash, dateTimeSeparator: Date.ISO8601FormatStyle.DateTimeSeparator = .standard, timeSeparator: Date.ISO8601FormatStyle.TimeSeparator = .colon, timeZoneSeparator: Date.ISO8601FormatStyle.TimeZoneSeparator = .omitted) -> Self
Parameters
includingFractionalSecondsSpecifies if the string contains fractional seconds.
dateSeparatorThe separator between date components.
dateTimeSeparatorThe separator between date and time parts.
timeSeparatorThe separator between time components.
timeZoneSeparatorThe separator between time parts in the time zone.
Return Value
A RegexComponent to match an ISO 8601 string, including time zone.