Skip to content
Yousif Al-Raheem edited this page Jan 21, 2020 · 1 revision

Outputs a date object regardless if the input is string or date object. If it is a string then it will be converted to a date object if it's valid, if it is a date object then it will be verified.

Example

console.log(toDate("2020-02-01", "YYYY-MM-DD")); // outputs a date object set to 2020-Feb-01

Properties

Param Type Description
value `string Date`
inputFormat string The input format for precision conversion, if any
Clone this wiki locally