pjs.toDate()

pjs.toDate()

 

The pjs.toDate() API converts a date string to a Date object. The format of the date string is controlled by the 'dateFormat' control option, or *ISO if the control  option is not specified.

Parameters
  • Date string - The date string to convert.

Return Value

Date object

Exception Handling

An Error is thrown if the date string cannot be converted.

Example
var controlOptions = { dateFormat: '*usa' }; function myProgram() { console.log(pjs.toDate('12/31/2020')); }