Creates and returns a text provider with the specified date and time zone.
SDK
- watchOS 2.0+
Framework
- Clock
Kit
Declaration
convenience init(date: Date, units calendarUnits: NSCalendar.Unit, timeZone: Time Zone?)
Parameters
date
The date to display. This parameter must not be
nil
.calendarUnits
The units to include in the resulting date string. For a list of supported calendar units, see Date Format Options.
timeZone
The time zone to use when formatting the date. If you specify
nil
, the text provider uses the time zone currently associated with the user.
Return Value
A text provider initialized with the specified date and time zone information.
Discussion
Date values are formatted according to the user’s current locale information.