---
title: Duration.TimeFormatStyle.Pattern
framework: swift
role: symbol
role_heading: Structure
path: swift/duration/timeformatstyle/pattern-swift.struct
---

# Duration.TimeFormatStyle.Pattern

The units — including hours, minutes, or seconds — and the configuration of those units, used to format a duration.

## Declaration

```swift
struct Pattern
```

## Overview

Overview Use a pattern when initializing a Duration.TimeFormatStyle, or creating a time format style from the convenience method Swift/Duration/TimeFormatStyle/time(pattern:). Use the type properties hourMinute, hourMinuteSecond, or minuteSecond to create patterns with default behavior. To customize how a pattern handles zero-padding and fractional parts, use one of the type methods that take these customizations as parameters.

## Topics

### Creating a pattern

- [hourMinute(padHourToLength:roundSeconds:)](swift/duration/timeformatstyle/pattern-swift.struct/hourminute(padhourtolength:roundseconds:).md)
- [hourMinuteSecond(padHourToLength:fractionalSecondsLength:roundFractionalSeconds:)](swift/duration/timeformatstyle/pattern-swift.struct/hourminutesecond(padhourtolength:fractionalsecondslength:roundfractionalseconds:).md)
- [minuteSecond(padMinuteToLength:fractionalSecondsLength:roundFractionalSeconds:)](swift/duration/timeformatstyle/pattern-swift.struct/minutesecond(padminutetolength:fractionalsecondslength:roundfractionalseconds:).md)

### Using common patterns

- [hourMinute](swift/duration/timeformatstyle/pattern-swift.struct/hourminute.md)
- [hourMinuteSecond](swift/duration/timeformatstyle/pattern-swift.struct/hourminutesecond.md)
- [minuteSecond](swift/duration/timeformatstyle/pattern-swift.struct/minutesecond.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

### Creating a time format style

- [init(pattern:locale:)](swift/duration/timeformatstyle/init(pattern:locale:).md)
