# Using DayJS in Calculators

**URL:** <https://community.synatic.com/t/using-dayjs-in-calculators/48>\
**Category:** Calculators\
**Tags:** dates, timezones\
**Created:** [February 19, 2021, 8:22am UTC](https://community.synatic.com/t/using-dayjs-in-calculators/48 "2021-02-19T08:22:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.synatic.com/martin/32/11_2.png) [@martin](https://community.synatic.com/u/martin)\
**Post date:** [February 19, 2021, 8:22am UTC](https://community.synatic.com/t/using-dayjs-in-calculators/48/1 "2021-02-19T08:22:16Z")

</div>

You can use the DayJS library for date manipulation in calculators: [DayJS Documentation](https://day.js.org/docs/en/manipulate/manipulate)

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.

**Formatting**

You can format a date to a string:

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

**Timezones**

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