Contents

formatOptions

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

Declaration

var formatOptions: ISO8601DateFormatter.Options { get set }

Discussion

The ISO 8601 specification allows for dates to be expressed in a variety of ways. You can configure the format used to parse and generate representations by specifying various combinations of format options.

Format

Example

Options

Date with dash separators

2016-06-13

Withfulldate, Withdashseparatorindate

Rfc3339 Date and Time

2016-06-13T16:00:00+00:00

Withinternetdatetime

Date and Time with space separator between date and time

20160613 160000

Withfulldate, Withfulltime, Withspacebetweendateandtime

Week of Year

2016-W24

Withyear, Withweekofyear, Withdashseparatorindate

Week of Year with Ordinal Weekday

2016-W24-1

Withyear, Withweekofyear, Withday, Withdashseparatorindate

Ordinal Day of Year

2016-165

Withyear, Withday, Withdashseparatorindate

See Also

Configuring the Formatter