![]() |
VOOZH | about |
The date-and-time.Date.preparse() is a minimalist collection of functions for manipulating JS date and time module which is used to pre-parse the date according to a certain pattern.
Required Module: Install the module by npm or used it locally.
npm install date-and-time --save
<script src="/path/to/date-and-time.min.js"></script>
Syntax:
preparse(dateString, arg)
Parameters: This method takes the following arguments as parameters:
Return Value: This method returns parsed date and time.
Example 1:
Run the index.js file using the following command:
node index.js
Output:
{
Y: 2021,
M: 3,
D: 7,
H: 0,
A: 0,
h: 0,
m: 0,
s: 0,
S: 0,
Z: 0,
_index: 8,
_length: 8,
_match: 3
}Example 2:
Run the index.js file using the following command:
node index.js
Output:
pre parsed date and time : 17