toTimeString Function

Format the time included in a date, optionally converting to time zone, if specified

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

@returns formatted time string

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

Returns - string

formatted time string

Defined in

Last Updated: 14 November, 2024