{ "id": "api/common/formatDate", "title": "formatDate", "contents": "\n\n
\n
\n
\n \n API > @angular/common\n
\n \n
\n \n
\n

formatDatelink

\n \n \n \n \n \n
\n \n \n\n
\n \n
\n

Formats a date according to locale rules.

\n\n \n
\n \n \n \n\n
\n \n\n formatDate(value: string | number | Date, format: string, locale: string, timezone?: string): string\n\n \n\n
Parameters
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n value\n string | number | Date\n

The date to format, as a Date, or a number (milliseconds since UTC epoch)\nor an ISO date-time string.

\n\n
\n \n format\n string\n

The date-time components to include. See DatePipe for details.

\n\n
\n \n locale\n string\n

A locale code for the locale format rules to use.

\n\n
\n \n timezone\n string\n

The time zone. A time zone offset from GMT (such as '+0430'),\nor a standard UTC/GMT or continental US time zone abbreviation.\nIf not specified, uses host system settings.

\n

Optional. Default is undefined.

\n\n
\n\n \n
Returns
\n

string: The formatted date string.

\n \n \n\n\n \n\n \n
\n\n\n \n
\n

See alsolink

\n \n
\n\n\n \n\n\n\n \n\n\n
\n
\n\n\n" }