fcf.parseDate() function
Package: fcf-framework-core
File: fcf-framework-core:fcf.js
Available from version: 2.0.2
Converts the string representation of a date and time to a
Arguments
- String representation of date and time
- The date and time format passed in the a_string argument
You can use the following characters in the format string
Y - Year (1000-9999)
m - Month (01-12)
d - Day (01-31)
H - Hour (00-23)
h - Hour (01-12)
a - am, pm
A - AM, PM
i - Minutes (00-59)
s - Seconds (00-59)
v - Milliseconds (000-999)
* - any character
Any other character declares its mandatory presence
\ is used to escape special characters.
- If false , then partially matching the date/time string with the pattern returns a Date object with partially filled fields. If true , then Invalid time is returned if the format does not match exactly.
- Default value of timestamp fields
- Time zone offset from current value ((new Date()).getTimezoneOffset(), if value is false , UTC time is used.
Result
- Date object
Example: Function application
let date = fcf.parseDate("1971-02-01T09:01:01", undefined, undefined, undefined, false);
console.log(date);
Output:
1971-02-01T09:01:01.000Z