Date.FormatStyle.Symbol.Minute
A type that specifies the format for the minutes in a date format style.
Declaration
struct MinuteOverview
The type Date.FormatStyle.Symbol.Minute includes static factory variables that create custom Date.FormatStyle.Symbol.Minute objects:
Factory variable | Description |
|---|---|
The minimum number of digits that represents the numeric minute. For example, | |
Two-digit numeric minute, zero-padded if necessary. For example, |
To customize the minute format in a string representation of a Date, use minute(_:). The following example shows a variety of Date.FormatStyle.Symbol.Minute format styles applied to a date.
let meetingDate = Date() // Feb 9, 2021 at 3:05 PM
meetingDate.formatted(Date.FormatStyle().minute(.defaultDigits)) // 5
meetingDate.formatted(Date.FormatStyle().minute(.twoDigits)) // 05
meetingDate.formatted(Date.FormatStyle().minute()) // 5If no format is specified as a parameter, the defaultDigits static variable is the default format.
For more information about formatting dates, see the Date.FormatStyle.
Topics
Modifying a Minute
Comparing a Minute
Type Properties
See Also
Modifying Date Style Format Symbols
Date.FormatStyle.Symbol.CyclicYearDate.FormatStyle.Symbol.DayDate.FormatStyle.Symbol.DayOfYearDate.FormatStyle.Symbol.DayPeriodDate.FormatStyle.Symbol.EraDate.FormatStyle.Symbol.HourDate.FormatStyle.Symbol.MonthDate.FormatStyle.Symbol.QuarterDate.FormatStyle.Symbol.SecondDate.FormatStyle.Symbol.SecondFractionDate.FormatStyle.Symbol.StandaloneMonthDate.FormatStyle.Symbol.StandaloneQuarterDate.FormatStyle.Symbol.StandaloneWeekdayDate.FormatStyle.Symbol.TimeZoneDate.FormatStyle.Symbol.VerbatimHour