Contents

DateComponentsFormatter.UnitsStyle

Constants for specifying how to represent quantities of time.

Declaration

enum UnitsStyle

Overview

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

Spellout

“nine hours, forty-one minutes, thirty seconds”

Full

“9 hours, 41 minutes, 30 seconds”

Short

“9 hr, 41 min, 30 sec”

Brief

“9hr 41min 30sec”

Abbreviated

“9h 41m 30s”

Positional

“9:31:30”

Topics

Styles

Initializers

See Also

Constants