Class

ISO8601Date​Formatter

The NSISO8601Date​Formatter class generates and parses string representations of dates following the ISO 8601 standard. Use this class to create ISO 8601 representations of dates and create dates from text strings in ISO 8601 format.

Nested Types

ISO8601Date​Formatter.Options

Options used to generate and parse ISO 8601 date representations.

Symbols

Configuring the Formatter

var format​Options:​ ISO8601Date​Formatter.Options

Options for generating and parsing ISO 8601 date representations. See ISO8601Date​Formatter.Options for possible values.

var time​Zone:​ Time​Zone!

The time zone used to create and parse date representations. When unspecified, GMT is used.

Creating ISO 8601 Date Formatters

init()

Initializes an ISO 8601 date formatter with default format, time zone, and options.

Converting ISO 8601 Dates

func string(from:​ Date)

Creates and returns an ISO 8601 formatted string representation of the specified date.

func date(from:​ String)

Creates and returns a date object from the specified ISO 8601 formatted string representation.

class func string(from:​ Date, time​Zone:​ Time​Zone, format​Options:​ ISO8601Date​Formatter.Options = [])

Creates a representation of the specified date with a given time zone and format options.

Constants

ISO8601Date​Formatter.Options

Options used to generate and parse ISO 8601 date representations.

Relationships

Inherits From