---
title: "hour(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/date/formatstyle/attributed-swift.struct/hour(_:)"
---

# hour(_:)

Change the representation of the hour in the format.

## Declaration

```swift
func hour(_ format: Date.FormatStyle.Symbol.Hour = .defaultDigits(amPM: .abbreviated)) -> Date.FormatStyle.Attributed
```

## Parameters

- `format`: Set the symbol representation or pass nil to remove it.
