Aug 10, 2020 09:59 AM
There are 2 fields of type “Data”.
What formula should be written for field 3 so that the difference in minutes between the fields ‘Date1’ and ‘Date2’ is calculated there?
Aug 10, 2020 11:53 AM
IF(
AND(date2,date1),
DATETIME_DIFF(date2, date1, 'minutes')
)
Aug 10, 2020 11:58 PM
No.
Aug 11, 2020 12:04 AM
Looks like you’ve got your date fields setup incorrectly. You’ll need to go into your customization options for your date fields, and make sure they’re both set to either GMT or not. They both need to be set to the exact same option. You can’t have one field set to GMT and the other field set to NON-GMT, because then you’re telling Airtable that your fields are in 2 different time zones.
Aug 11, 2020 12:21 AM
They are the same
Aug 11, 2020 01:00 AM
I wasn’t looking too carefully at the actual dates you typed in, but the formula that I gave you is giving you the exact number of minutes that have elapsed between Date 1 and Date 2. Are you saying that you want it to completely ignore the dates altogether and just look at the times?
Aug 11, 2020 01:04 AM
Yes. I just need time. The day of the month and year can be left alone
Aug 11, 2020 08:21 AM
If you’re ignoring the dates, then I would probably do it like this.
This formula will extract the time from the date fields as 24-hour military time, and then the math can be done on those military times:
IF(
AND(Date2,Date1),
DATETIME_DIFF(
DATETIME_PARSE(TIMESTR(Date2),'HH:mm'),
DATETIME_PARSE(TIMESTR(Date1),'HH:mm'),
'minutes'
)
)