formatDate
Formats a date according to locale rules.
formatDate(value: string | number | Date, format: string, locale: string, timezone?: string): string
Parameters
| value |
Type: |
| format |
Type: |
| locale |
Type: |
| timezone |
Type: Optional. Default is |
Returns
string
Description
Where:
valueis a Date, a number (milliseconds since UTC epoch) or an ISO string (https://www.w3.org/TR/NOTE-datetime).formatindicates which date/time components to include. SeeDatePipefor more details.localeis astringdefining the locale to use.timezoneto be used for formatting. It understands UTC/GMT and the continental US time zone abbreviations, but for general use, use a time zone offset (e.g.'+0430'). If not specified, host system settings are used.
See DatePipe for more details.