---
title: "hourMinute(padHourToLength:roundSeconds:)"
framework: swift
role: symbol
role_heading: Type Method
path: "swift/duration/timeformatstyle/pattern-swift.struct/hourminute(padhourtolength:roundseconds:)"
---

# hourMinute(padHourToLength:roundSeconds:)

Returns a pattern to format a duration with hours and minutes only, with the given unit configurations.

## Declaration

```swift
static func hourMinute(padHourToLength: Int, roundSeconds: FloatingPointRoundingRule = .toNearestOrEven) -> Duration.TimeFormatStyle.Pattern
```

## Parameters

- `padHourToLength`: Padding for the hour field. For example, setting this value to 2 formats one hour as 01:00 in the en_US locale.
- `roundSeconds`: The rule to use for rounding the minutes value, given the remaining seconds value. Use one of the cases from the doc://com.apple.Swift/documentation/Swift/FloatingPointRoundingRule enumeration.

## Return Value

Return Value A Duration.TimeFormatStyle.Pattern that formats a duration with hours and minutes only, using the given unit configurations.

## See Also

### Creating a pattern

- [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)
