Help

Re: DATETIME_DIFF() and Incorrect Timezone

1760 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Wayne_Olson
5 - Automation Enthusiast
5 - Automation Enthusiast

Hey there, Airtable Experts…

I have created a simple task table where I am attempting to use a formula field to automatically categorize individual tasks based on their due dates, i.e., Overdue, Due Today, Due Soon (2 days or less), etc. I have used the following formula:

IF(DATETIME_DIFF({Due Date}, NOW(), 'days') < 0, "1. Overdue", IF(DATETIME_DIFF({Due Date}, NOW(), 'days') = 0, "2. Today", IF(DATETIME_DIFF({Due Date}, NOW(), 'days') <= 2, "3. Due Soon (2 days or less)", IF(DATETIME_DIFF({Due Date}, NOW(), 'days') <= 7, "4. Upcoming (7 days or less)", IF(DATETIME_DIFF({Due Date}, NOW(), 'days') > 7, "5. Future", BLANK())))))

The challenge I’m having is that the calculated difference between the due date and the current date yields the incorrect category, i.e., items due today are showing as overdue, and items showing due tomorrow are showing as due today. This leads me to believe the timezone is incorrect.

I have tried swapping NOW() for TODAY(), but that only yields the same result.

Anyone have any idea what the issue may be and how to correct it?

Many thanks for your help!

10 Replies 10

Well, strictly speaking, it’s not: Since collaborators can be anywhere in the world, datetime calculations default to UTC.

Something to keep in mind — and it still screws me up regularly — is that selecting the ‘Use the same timezone (GMT) for all collaborators’ box does not merely specify a formatting option: It causes a modification to the underlying data. Selecting/deselecting the box does not simply toggle the presented value back and forth.