parseDate

Converts a string into a Date object based on the specified format and locale

For a runnable example, refer to the article on
date and number formatting and parsing.

Parameters

value string

Defines the string that will be parsed.

format? string | DateFormatOptions | string[] | DateFormatOptions[]

Defines a string that represents a predefined or custom date format, a configuration object, or an array of formats that will be used to parse the value.

locale? string

The optional locale id. If not specified, the id of the "en" locale is used.

Returns

Date - The parsed date.