---
id: fast-foundation.dateformatter
title: DateFormatter class
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)

## DateFormatter class

Date formatting utility

<b>Signature:</b>

```typescript
export declare class DateFormatter 
```

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(config)](./fast-foundation.dateformatter._constructor_.md) |  | Constructs a new instance of the <code>DateFormatter</code> class |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [date](./fast-foundation.dateformatter.date.md) |  | Date | Date used for formatting |
|  [dayFormat](./fast-foundation.dateformatter.dayformat.md) |  | [DayFormat](./fast-foundation.dayformat.md) | Formatting for the day |
|  [locale](./fast-foundation.dateformatter.locale.md) |  | string | Localization settings to use for formatting |
|  [monthFormat](./fast-foundation.dateformatter.monthformat.md) |  | [MonthFormat](./fast-foundation.monthformat.md) | Formatting for the month |
|  [weekdayFormat](./fast-foundation.dateformatter.weekdayformat.md) |  | [WeekdayFormat](./fast-foundation.weekdayformat.md) | Formatting for the weekday labels |
|  [yearFormat](./fast-foundation.dateformatter.yearformat.md) |  | [YearFormat](./fast-foundation.yearformat.md) | Formatting for the year |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [getDate(date, format, locale)](./fast-foundation.dateformatter.getdate.md) |  |  |
|  [getDateObject(date)](./fast-foundation.dateformatter.getdateobject.md) |  | Helper function to make sure that the DateFormatter is working with an instance of Date |
|  [getDay(day, format, locale)](./fast-foundation.dateformatter.getday.md) |  |  |
|  [getMonth(month, format, locale)](./fast-foundation.dateformatter.getmonth.md) |  |  |
|  [getWeekday(weekday, format, locale)](./fast-foundation.dateformatter.getweekday.md) |  |  |
|  [getWeekdays(format, locale)](./fast-foundation.dateformatter.getweekdays.md) |  |  |
|  [getYear(year, format, locale)](./fast-foundation.dateformatter.getyear.md) |  |  |
