DATETIME_DIFF is off by 1 minute when referencing Lookup fields

Topic Labels: Formulas
599 0
Showing results for 
Search instead for 
Did you mean: 
6 - Interface Innovator
6 - Interface Innovator

I use DATETIME_DIFF to calculate hours worked by employees for a given job. I have a Jobs table and a Time Logs table. Employees check-in and check-out to each job in the Time Logs table, then I calculate their hours worked back in the Jobs table with a DATETIME_DIFF formula that references the “Check-In” and “Check-Out” Lookup fields that automatically lookup the corresponding Time Log records. It’s a pretty elegant solution to time tracking and I’ve loved using it for months.

Today, I had an employee that I needed to pay for exactly 2 hrs of work, so I manually adjusted their check-out Time Log record to exactly 2 hrs after their check-in time. When I went back to the Job record, I realized by DATETIME_DIFF field was displaying “119” minutes instead of “120” minutes.

My first thought was “maybe Airtable is keeping track of a seconds value that I can’t see in the UI”, so I copy/pasted the date/time values into a separate table to test. In that table, the same date/time values and formula gave me “120”.

Now I’m really stumped. Have I been short-changing my employees this entire time? Is this a bug or something I’m overlooking?

0 Replies 0