Jun 03, 2022 11:25 AM
Hello,
I have a big favor to ask, which is basically, can someone help fix this formula? I am creating a Yes/No flag to display content using the TODAY() function, but I need it to determine TODAY() by Eastern Standard Time. This is what I have and its not working…
IF(SET_TIMEZONE(TODAY(), ‘America/New_York’) = {Prayer Point Date}, “Yes”, “No”)
The conditional piece works great, it’s the TIME_ZONE that’s a bust. All help is appreciated.
Jun 03, 2022 12:38 PM
SET_TIMEZONE must be used in conjunction with DATETIME_FORMAT, so it would need to look something along the lines of this:
DATETIME_FORMAT(SET_TIMEZONE(TODAY(),'America/New_York'), 'M/D/YYYY h:mma')
Jun 03, 2022 01:06 PM
Thank you very much for your time and help. So… when I use this:
DATETIME_FORMAT(SET_TIMEZONE(TODAY(),'America/New_York'), 'M/D/YYYY')
It’s coming up as yesterday. Thoughts?
Jun 03, 2022 01:39 PM
Jun 03, 2022 05:41 PM
Hi @Bill.French . My timezone is ‘America/New_York’ and unless I’m losing my mind, yours isn’t right either. Today is the third.
I also am not sure in my “check against this date” Field what format I should use to actually get a match. I use it as a display element, so I’d like it to look like “June 3, 2022.” But I don’t know what corresponding format to use in my formula.
Jun 03, 2022 06:07 PM
Ah okay, so I see what the problem is here.
Airtable acts REALLY strange when it comes to time zones, which is why I created this sample base & training video:
However, your issue is a completely different issue than what I solved above.
When you specify TODAY() in a formula like the above formulas without specifying a time, Airtable chooses midnight on your behalf as the default time. But — here’s the catch — Airtable chooses midnight as if you were in the GMT time zone before applying the New York Time Zone conversion! :crazy_face:
So, when you tell Airtable that you want New York time zone without specifying a time, Airtable starts with midnight GMT, and then subtracts 4 hours from there to get New York. Makes very little sense. :man_shrugging:
So what you’re actually seeing on screen is 8:00pm yesterday night.
In other words, it’s showing you “today at midnight in the GMT Time Zone” which is the equivalent of “yesterday at 8:00pm in the New York Time Zone”.
But if you just need to see today’s date — with no worries about the time — perhaps you can just use TODAY() all on its own in the formula, and be sure to turn on GMT in the date formatting options.
Jun 03, 2022 06:18 PM
OK, Scott. I’m going to go with that and see if it changes correctly at midnight. I just don’t want it to change too early.
I really appreciate your time. Have a great day! Thank you, @Bill.French, for your time, too.
Jun 03, 2022 06:20 PM
Oh, right, that might be a problem. Lol.
We will probably need to come up with a more complicated formula to solve your problem. But I won’t be back at my computer until tomorrow to try to play with this.
In the meantime, take a look at my sample base above. It might shed some partial light on this situation.
Jun 03, 2022 06:22 PM
Ah… OK. No problem. I started watching your tutorial yesterday, but haven’t had time to finish it. I’ll try to get more time in on that, too.
Thank you, again! Have a good night. - Doug
Jun 03, 2022 06:23 PM
If you just needed “today” to display during normal business hours, it probably wouldn’t be an issue. But since you’re looking for precision timing, that’s where the complexity comes in.