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

Creates a new FormatStyle with the given configurations.

iOS
15.0+
macOS
12.0+
tvOS
15.0+
watchOS
8.0+
init(date: Date.FormatStyle.DateStyle? = nil, time: Date.FormatStyle.TimeStyle? = nil, locale: Locale = .autoupdatingCurrent, calendar: Calendar = .autoupdatingCurrent, timeZone: TimeZone = .autoupdatingCurrent, capitalizationContext: FormatStyleCapitalizationContext = .unknown)

Parameters

date

The date style for formatting the date.

time

The time style for formatting the date.

locale

The locale to use when formatting date and time values.

calendar

The calendar to use for date values.

timeZone

The time zone with which to specify date and time values.

capitalizationContext

The capitalization formatting context used when formatting date and time values.