DateComponentsFormatter.UnitsStyle
Constants for specifying how to represent quantities of time.
Declaration
enum UnitsStyleOverview
All date and time values are localized and formatted according to the current user’s language preferences.
The following table shows how the quantity of 9 hours, 41 minutes, and 30 seconds is displayed in the U.S. English locale for each style:
Style | Displayed result |
|---|---|
“nine hours, forty-one minutes, thirty seconds” | |
“9 hours, 41 minutes, 30 seconds” | |
“9 hr, 41 min, 30 sec” | |
“9hr 41min 30sec” | |
“9h 41m 30s” | |
“9:31:30” |
Topics
Styles
DateComponentsFormatter.UnitsStyle.spellOutDateComponentsFormatter.UnitsStyle.fullDateComponentsFormatter.UnitsStyle.shortDateComponentsFormatter.UnitsStyle.briefDateComponentsFormatter.UnitsStyle.abbreviatedDateComponentsFormatter.UnitsStyle.positional