formatDate
function
stable
Formats a date according to locale rules.
API
function formatDate(
value: string | number | Date,
format: string,
locale: string,
timezone?: string | undefined,
): string;@paramvalue
string | number | DateThe date to format, as a Date, or a number (milliseconds since UTC epoch) or an ISO date-time string.
@paramlocale
stringA locale code for the locale format rules to use.
@paramtimezone
string | undefinedThe time zone. A time zone offset from GMT (such as '+0430').
If not specified, uses host system settings.
@returns
stringThe formatted date string.
Jump to details