---
title: unitsStyle
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/datecomponentsformatter/unitsstyle-swift.property
---

# unitsStyle

The formatting style for unit names.

## Declaration

```swift
var unitsStyle: DateComponentsFormatter.UnitsStyle { get set }
```

## Discussion

Discussion Configures the strings to use (if any) for unit names such as days, hours, minutes, and seconds. Use this property to specify whether you want abbreviated or shortened versions of unit names—for example, hrs instead of hours. The default value of this property is DateComponentsFormatter.UnitsStyle.positional.

## See Also

### Configuring the Formatter Options

- [allowedUnits](foundation/datecomponentsformatter/allowedunits.md)
- [allowsFractionalUnits](foundation/datecomponentsformatter/allowsfractionalunits.md)
- [calendar](foundation/datecomponentsformatter/calendar.md)
- [collapsesLargestUnit](foundation/datecomponentsformatter/collapseslargestunit.md)
- [includesApproximationPhrase](foundation/datecomponentsformatter/includesapproximationphrase.md)
- [includesTimeRemainingPhrase](foundation/datecomponentsformatter/includestimeremainingphrase.md)
- [maximumUnitCount](foundation/datecomponentsformatter/maximumunitcount.md)
- [zeroFormattingBehavior](foundation/datecomponentsformatter/zeroformattingbehavior-swift.property.md)
