One Logo Pool Ball
Foundation · IOS API REFERENCE

DateComponents.ISO8601FormatStyle

struct · iOS 26.0+ · SDK 27.1

struct ISO8601FormatStyle

Options for generating and parsing string representations of dates following the ISO 8601 standard.

Members (22)

method · iOS 26.0+

weekOfYear

TypeScript
weekOfYear(): DateComponents_ISO8601FormatStyle
Swift declaration
func weekOfYear() -> DateComponents.ISO8601FormatStyle
init · iOS 26.0+

init

TypeScript
static init(dateSeparator?: Date_ISO8601FormatStyle_DateSeparator, dateTimeSeparator?: Date_ISO8601FormatStyle_DateTimeSeparator, timeSeparator?: Date_ISO8601FormatStyle_TimeSeparator, timeZoneSeparator?: Date_ISO8601FormatStyle_TimeZoneSeparator, includingFractionalSeconds?: boolean, timeZone?: TimeZone): DateComponents_ISO8601FormatStyle
Swift declaration
init(dateSeparator: Date.ISO8601FormatStyle.DateSeparator = .dash, dateTimeSeparator: Date.ISO8601FormatStyle.DateTimeSeparator = .standard, timeSeparator: Date.ISO8601FormatStyle.TimeSeparator = .colon, timeZoneSeparator: Date.ISO8601FormatStyle.TimeZoneSeparator = .omitted, includingFractionalSeconds: Bool = false, timeZone: TimeZone = TimeZone(secondsFromGMT: 0)!)
get · iOS 26.0+

dateSeparator

TypeScript
get dateSeparator(): Date_ISO8601FormatStyle_DateSeparator
Swift declaration
var dateSeparator: Date.ISO8601FormatStyle.DateSeparator { get }
method · iOS 26.0+

dateSeparator

TypeScript
dateSeparator82597(separator: Date_ISO8601FormatStyle_DateSeparator): DateComponents_ISO8601FormatStyle
Swift declaration
func dateSeparator(_ separator: Date.ISO8601FormatStyle.DateSeparator) -> DateComponents.ISO8601FormatStyle
get · iOS 26.0+

parseStrategy

TypeScript
get parseStrategy(): DateComponents_ISO8601FormatStyle
Swift declaration
var parseStrategy: DateComponents.ISO8601FormatStyle { get }

A `ParseStrategy` that can be used to parse this `FormatStyle`'s output

get · iOS 26.0+

timeSeparator

TypeScript
get timeSeparator(): Date_ISO8601FormatStyle_TimeSeparator
Swift declaration
var timeSeparator: Date.ISO8601FormatStyle.TimeSeparator { get }
method · iOS 26.0+

timeSeparator

TypeScript
timeSeparator53903(separator: Date_ISO8601FormatStyle_TimeSeparator): DateComponents_ISO8601FormatStyle
Swift declaration
func timeSeparator(_ separator: Date.ISO8601FormatStyle.TimeSeparator) -> DateComponents.ISO8601FormatStyle
get · iOS 26.0+

dateTimeSeparator

TypeScript
get dateTimeSeparator(): Date_ISO8601FormatStyle_DateTimeSeparator
Swift declaration
var dateTimeSeparator: Date.ISO8601FormatStyle.DateTimeSeparator { get }
method · iOS 26.0+

dateTimeSeparator

TypeScript
dateTimeSeparator94179(separator: Date_ISO8601FormatStyle_DateTimeSeparator): DateComponents_ISO8601FormatStyle
Swift declaration
func dateTimeSeparator(_ separator: Date.ISO8601FormatStyle.DateTimeSeparator) -> DateComponents.ISO8601FormatStyle
get · iOS 26.0+

timeZoneSeparator

TypeScript
get timeZoneSeparator(): Date_ISO8601FormatStyle_TimeZoneSeparator
Swift declaration
var timeZoneSeparator: Date.ISO8601FormatStyle.TimeZoneSeparator { get }
method · iOS 26.0+

timeZoneSeparator

TypeScript
timeZoneSeparator71688(separator: Date_ISO8601FormatStyle_TimeZoneSeparator): DateComponents_ISO8601FormatStyle
Swift declaration
func timeZoneSeparator(_ separator: Date.ISO8601FormatStyle.TimeZoneSeparator) -> DateComponents.ISO8601FormatStyle
get · iOS 26.0+

includingFractionalSeconds

TypeScript
get includingFractionalSeconds(): boolean
Swift declaration
var includingFractionalSeconds: Bool { get }

If set, fractional seconds will be present in formatted output. Fractional seconds may be present in parsing regardless of the setting of this property.

method · iOS 26.0+

day

TypeScript
day(): DateComponents_ISO8601FormatStyle
Swift declaration
func day() -> DateComponents.ISO8601FormatStyle
method · iOS 26.0+

time

TypeScript
time(includingFractionalSeconds: boolean): DateComponents_ISO8601FormatStyle
Swift declaration
func time(includingFractionalSeconds: Bool) -> DateComponents.ISO8601FormatStyle
method · iOS 26.0+

year

TypeScript
year(): DateComponents_ISO8601FormatStyle
Swift declaration
func year() -> DateComponents.ISO8601FormatStyle
method · iOS 26.0+

month

TypeScript
month(): DateComponents_ISO8601FormatStyle
Swift declaration
func month() -> DateComponents.ISO8601FormatStyle
method · iOS 26.0+

parse

TypeScript
parse(value: string): DateComponents
Swift declaration
func parse(_ value: String) throws -> DateComponents

Parses a value, using this strategy. This method throws an error if the parse strategy can't parse `value`. - Parameter value: A value whose type matches the strategy's ``ParseStrategy/ParseInput`` type. - Returns: A parsed value of the type declared by ``ParseStrategy/ParseOutput``.

method · iOS 26.0+

format

TypeScript
format(value: DateComponents): string
Swift declaration
func format(_ value: DateComponents) -> String

Formats a value, using this style. Use this method when you want to create a single style instance, and then use it to format multiple values. - Parameter value: The value to format. - Returns: A representation of `value`, in the ``FormatOutput`` type, formatted according to the style's configuration.

method · iOS 26.0+

timeZone

TypeScript
timeZoneSeparator86974(separator: Date_ISO8601FormatStyle_TimeZoneSeparator): DateComponents_ISO8601FormatStyle
Swift declaration
func timeZone(separator: Date.ISO8601FormatStyle.TimeZoneSeparator) -> DateComponents.ISO8601FormatStyle
get · iOS 26.0+

timeZone

TypeScript
get timeZone(): TimeZone
Swift declaration
var timeZone: TimeZone { get set }

The time zone to use to create and parse date representations.

set · iOS 26.0+

timeZone

TypeScript
set timeZone(value: TimeZone)
Swift declaration
var timeZone: TimeZone { get set }

The time zone to use to create and parse date representations.

method · iOS 26.0+

consuming

TypeScript
consuming(input: string, index: SDKHandle, bounds: SDKHandle): ({ "upperBound": SDKHandle; "output": DateComponents }) | null
Swift declaration
func consuming(_ input: String, startingAt index: String.Index, in bounds: Range<String.Index>) throws -> (upperBound: String.Index, output: DateComponents)?

Process the input string within the specified bounds, beginning at the given index, and return the end position (upper bound) of the match and the produced output. - Parameters: - input: The string in which the match is performed. - index: An index of `input` at which to begin matching. - bounds: The bounds in `input` in which the match is performed. - Returns: The upper bound where the match terminates and a matched instance, or `nil` if there isn't a match.

Skipped declarations

No declarations were skipped in this snapshot.

All Foundation types →