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

# dayOfYear(_:)

Change the representation of the day of the year in the format.

## Declaration

```swift
func dayOfYear(_ format: Date.FormatStyle.Symbol.DayOfYear = .defaultDigits) -> Date.FormatStyle.Attributed
```

## Parameters

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