Contents

init(date:time:locale:calendar:timeZone:)

Creates an instance using the provided date, time, locale, calendar, time zone, and capitalization context.

Declaration

init(date: Date.IntervalFormatStyle.DateStyle? = nil, time: Date.IntervalFormatStyle.TimeStyle? = nil, locale: Locale = .autoupdatingCurrent, calendar: Calendar = .autoupdatingCurrent, timeZone: TimeZone = .autoupdatingCurrent)

Parameters

  • date:

    The Datestyle for creating the string representation of the date interval.

  • time:

    The Timestyle for creating the string representation of the date interval.

  • locale:

    The Locale for creating the string representation of the date interval.

  • calendar:

    The Calendar for creating the string representation of the date interval.

  • timeZone:

    The Timezone for creating the string representation of the date interval.

Discussion

Customize the date interval string by providing a date style, time style, locale, calendar, time zone, and capitalization scheme.

Values for date style are complete, long, abbreviated, numeric, omitted, or none. Time style values are complete, standard, shortened, omitted, or none.