DEV Community

Alex Karoza
Alex Karoza

Posted on


Local time of employees in Notion

Companies that have many employees working remotely, it's important to know the time of employees in their local time zone.

Unfortunately, Notion doesn't have a function to display UTC time, but a little magic and here's the formula:

formatDate(dateAdd(dateSubtract(now(), toNumber(formatDate(now(), "Z")), "hours"), prop("UTC"), "hours"), "HH:mm")
Enter fullscreen mode Exit fullscreen mode

UTC is the column that contains the difference between the employee's local time and Greenwich Mean Time. In the table, this column can be hidden.

The formula is used to get the UTC time:

dateSubtract(now(), toNumber(formatDate(now(), "Z")), "hours")
Enter fullscreen mode Exit fullscreen mode

The magic is hidden here: formatDate(now(), "Z"), Z is the time zone in ISO 8601. Our timezone is subtracted from our local time, thus obtaining UTC (GMT) time.

Oldest comments (0)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git