Using DayJS in Calculators

You can use the DayJS library for date manipulation in calculators: DayJS Documentation

The DayJS library is created by calling the dayjs method of utils:

let newDate=utils.dayjs('2021-02-17');

This would create a new date from the specified string.


You can format a date to a string:

let newDate=utils.dayjs('2021-02-17').format('MM-DD-YYYY');


You can specify a timezone to create the date with:

let newDate=utils.dayjs('2021-02-17','America/New_York');

Specifying utc will force the date to be recorded as utc:

let newDate=utils.dayjs('2021-02-17','utc');

You can also convert dates between different timezones:

let newDate=utils.dayjs('2021-02-17','utc').tz('America/New_York');