---
title: withYear
framework: foundation
role: symbol
role_heading: Type Property
path: foundation/iso8601dateformatter/options/withyear
---

# withYear

## Declaration

```swift
static var withYear: ISO8601DateFormatter.Options { get }
```

## Discussion

Discussion The date representation includes the year. The format for year is inferred based on the other specified options. If withWeekOfYear is specified, YYYY is used. Otherwise, yyyy is used.

## See Also

### Constants

- [withMonth](foundation/iso8601dateformatter/options/withmonth.md)
- [withWeekOfYear](foundation/iso8601dateformatter/options/withweekofyear.md)
- [withDay](foundation/iso8601dateformatter/options/withday.md)
- [withTime](foundation/iso8601dateformatter/options/withtime.md)
- [withTimeZone](foundation/iso8601dateformatter/options/withtimezone.md)
- [withSpaceBetweenDateAndTime](foundation/iso8601dateformatter/options/withspacebetweendateandtime.md)
- [withDashSeparatorInDate](foundation/iso8601dateformatter/options/withdashseparatorindate.md)
- [withColonSeparatorInTime](foundation/iso8601dateformatter/options/withcolonseparatorintime.md)
- [withColonSeparatorInTimeZone](foundation/iso8601dateformatter/options/withcolonseparatorintimezone.md)
- [withFullDate](foundation/iso8601dateformatter/options/withfulldate.md)
- [withFullTime](foundation/iso8601dateformatter/options/withfulltime.md)
- [withInternetDateTime](foundation/iso8601dateformatter/options/withinternetdatetime.md)
