---
id: fast-foundation.dateformatter.getyear
title: DateFormatter.getYear() method
hide_title: true
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[@microsoft/fast-foundation](./fast-foundation.md) &gt; [DateFormatter](./fast-foundation.dateformatter.md) &gt; [getYear](./fast-foundation.dateformatter.getyear.md)

## DateFormatter.getYear() method

<b>Signature:</b>

```typescript
getYear(year?: number, format?: YearFormat, locale?: string): string;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  year | number | The year to localize |
|  format | [YearFormat](./fast-foundation.yearformat.md) | The formatting for the year |
|  locale | string | The locale data used for formatting |

<b>Returns:</b>

string

- A localized string for the year
