[ Web Proxy ]
URL:
Viewing: https://angular.dev/api/common/formatDate [Back]  [Original]

formatDate Angular Skip to main content
menu
close
more_horiz
menuAPI
@angular/common

formatDate

function
stable

Formats a date according to locale rules.

DatePipeInternationalization (i18n) Guide

On this page

    arrow_upward_alt Back to the top

    API

    function formatDate(
      value: string | number | Date,
      format: string,
      locale: string,
      timezone?: string | undefined,
    ): string;
    @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

    The formatted date string.

    Description

    Formats a date according to locale rules.


    Exported by

    Jump to details

    Web Proxy Viewer  |  New URL  |  Original Page