ƒ.date - Get-Kraken/fixx GitHub Wiki

ƒ.date.parse

parse[format]('dateString')

parse string to date object in a specific input format

current supported formats:
dd/mm/yyyy HH:MM:SS
YYYY-MM-DD

example:

ƒ.date.parse['dd/mm/yyyy HH:MM:SS']('30/12/2019 23:15:01');
// → Date {Mon Dec 30 2019 23:15:01 GMT+0000 (GMT Daylight Time)}

ƒ.date.convertTo

convertTo[format]({date:dateObj, locale:outputLocale}) (requires ƒ.static)

print a date string from a date object and supplied locale (see ƒ.static)

current supported formats: (can be manually extended to support more)
d M yyyy
dd/mm/yyyy HH:MM:SS

example:

ƒ.date.convertTo['d M yyyy']({date: new Date('2019-01-01'), locale: 'en-gb'});

ƒ.date.now

.now() returns client machine's current date stamp as a date object. (i.e. new Date())
ƒ.date.now();