<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/DateComponentsFormatter/UnitsStyle-swift.enum",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSDateComponentsFormatterUnitsStyle"
  },
  "title" : "DateComponentsFormatter.UnitsStyle"
}
-->

# DateComponentsFormatter.UnitsStyle

Constants for specifying how to represent quantities of time.

```
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                               |
|-----------------------------------------------------------------------------------------------------------------|-----------------------------------------------|
|``doc://com.apple.foundation/documentation/Foundation/DateComponentsFormatter/UnitsStyle-swift.enum/spellOut``   |“nine hours, forty-one minutes, thirty seconds”|
|``doc://com.apple.foundation/documentation/Foundation/DateComponentsFormatter/UnitsStyle-swift.enum/full``       |“9 hours, 41 minutes, 30 seconds”              |
|``doc://com.apple.foundation/documentation/Foundation/DateComponentsFormatter/UnitsStyle-swift.enum/short``      |“9 hr, 41 min, 30 sec”                         |
|``doc://com.apple.foundation/documentation/Foundation/DateComponentsFormatter/UnitsStyle-swift.enum/brief``      |“9hr 41min 30sec”                              |
|``doc://com.apple.foundation/documentation/Foundation/DateComponentsFormatter/UnitsStyle-swift.enum/abbreviated``|“9h 41m 30s”                                   |
|``doc://com.apple.foundation/documentation/Foundation/DateComponentsFormatter/UnitsStyle-swift.enum/positional`` |“9:31:30”                                      |

## Topics

### Styles

[`NSDateComponentsFormatterUnitsStyleSpellOut`](/documentation/Foundation/DateComponentsFormatter/UnitsStyle-swift.enum/spellOut)

A style that spells out the units and quantities of time.

[`NSDateComponentsFormatterUnitsStyleFull`](/documentation/Foundation/DateComponentsFormatter/UnitsStyle-swift.enum/full)

A style that spells out the units of time, but not the quantities.

[`NSDateComponentsFormatterUnitsStyleShort`](/documentation/Foundation/DateComponentsFormatter/UnitsStyle-swift.enum/short)

A style that uses a shortened spelling for units.

[`NSDateComponentsFormatterUnitsStyleBrief`](/documentation/Foundation/DateComponentsFormatter/UnitsStyle-swift.enum/brief)

A style that uses a shortened spelling for units of time that is shorter than [`DateComponentsFormatter.UnitsStyle.short`](/documentation/Foundation/DateComponentsFormatter/UnitsStyle-swift.enum/short).

[`NSDateComponentsFormatterUnitsStyleAbbreviated`](/documentation/Foundation/DateComponentsFormatter/UnitsStyle-swift.enum/abbreviated)

A style that uses the most abbreviated spelling for units of time.

[`NSDateComponentsFormatterUnitsStylePositional`](/documentation/Foundation/DateComponentsFormatter/UnitsStyle-swift.enum/positional)

A style that uses the position of a unit of time to identify its value.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)