toDateString Function

Format a date in a display string, optionally converting to time zone, if specified by timeZoneOffset

toDateString(date: Date, timeZoneOffset?: number, formatOptions?: DateFormatOptions): string

@returns formatted date string

Parameter Type Description
date Date Date object to format
timeZoneOffset number optional: offset from UTC to use for conversion
formatOptions DateFormatOptions optional: allow locale and format for output Date string. If not defined current locale options are used.

Returns - string

formatted date string

Defined in

Last Updated: 17 December, 2024