<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Duration/TimeFormatStyle/Pattern-swift.struct/hourMinute(padHourToLength:roundSeconds:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s8DurationV10FoundationE15TimeFormatStyleV7PatternV10hourMinute15padHourToLength12roundSecondsAGSi_s25FloatingPointRoundingRuleOtFZ"
  },
  "title" : "hourMinute(padHourToLength:roundSeconds:)"
}
-->

# hourMinute(padHourToLength:roundSeconds:)

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

```
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 [`FloatingPointRoundingRule`](/documentation/Swift/FloatingPointRoundingRule) enumeration.

## Return Value

A [`Duration.TimeFormatStyle.Pattern`](/documentation/Swift/Duration/TimeFormatStyle/Pattern-swift.struct) that formats a duration with hours and minutes only, using the given unit configurations.

---

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)