• Overview
@angular/common

formatDate

function

Formats a date according to locale rules.

  
    function formatDate(  value: string | number | Date,  format: string,  locale: string,  timezone?: string | undefined): string;
  
  

formatDate

string

Formats a date according to locale rules.

@paramvaluestring | number | Date

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

@paramformatstring

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

@paramlocalestring

A locale code for the locale format rules to use.

@paramtimezonestring | undefined

The time zone. A time zone offset from GMT (such as '+0430'). If not specified, uses host system settings.

@returnsstring
Jump to details