---
title: Duration.UnitsFormatStyle.Unit
framework: swift
role: symbol
role_heading: Structure
path: swift/duration/unitsformatstyle/unit
---

# Duration.UnitsFormatStyle.Unit

A unit to use in formatting a duration.

## Declaration

```swift
struct Unit
```

## Overview

Overview Supported units range from hours to nanoseconds. Use these with the allowed parameter of the Duration.UnitsFormatStyle initializers to specify which units to use in a formatted string.

## Topics

### Duration units

- [hours](swift/duration/unitsformatstyle/unit/hours.md)
- [minutes](swift/duration/unitsformatstyle/unit/minutes.md)
- [seconds](swift/duration/unitsformatstyle/unit/seconds.md)
- [milliseconds](swift/duration/unitsformatstyle/unit/milliseconds.md)
- [microseconds](swift/duration/unitsformatstyle/unit/microseconds.md)
- [nanoseconds](swift/duration/unitsformatstyle/unit/nanoseconds.md)

### Type Properties

- [days](swift/duration/unitsformatstyle/unit/days.md)
- [weeks](swift/duration/unitsformatstyle/unit/weeks.md)

## Relationships

### Conforms To

- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Working with units

- [allowedUnits](swift/duration/unitsformatstyle/allowedunits.md)
- [maximumUnitCount](swift/duration/unitsformatstyle/maximumunitcount.md)
- [valueLengthLimits](swift/duration/unitsformatstyle/valuelengthlimits.md)
