pjs.toDate()

pjs.toDate()

Description

The pjs.toDate() API converts a date string to a date value. The format of the date string is controlled by the dateFormat control option, or *iso if that control option is not specified.

Parameters

  1. Date string - The date string to convert.

Return Value

A date value.

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')); }

Related Pages