---
title: "padded(_:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/date/formatstyle/symbol/year/padded(_:)"
---

# padded(_:)

Returns a custom format style that portrays the year of the calendar system of the provided length, zero-padded if necessary.

## Declaration

```swift
static func padded(_ length: Int) -> Date.FormatStyle.Symbol.Year
```

## Parameters

- `length`: The length of the string to display a calendar year.

## Return Value

Return Value A custom year format style that portrays the year of the calendar system with the provided length.

## Discussion

Discussion Use padded(_:) to display a year using three or more digits, zero-padded if necessary. For example, 002, 020, 201, 2017.

## See Also

### Modifying a Year

- [defaultDigits](foundation/date/formatstyle/symbol/year/defaultdigits.md)
- [twoDigits](foundation/date/formatstyle/symbol/year/twodigits.md)
- [relatedGregorian(minimumLength:)](foundation/date/formatstyle/symbol/year/relatedgregorian(minimumlength:).md)
- [extended(minimumLength:)](foundation/date/formatstyle/symbol/year/extended(minimumlength:).md)
