Is anyone great with Airtable formulas? I need hel...
# 2-ask-for-advice
a
Is anyone great with Airtable formulas? I need help with an events table displaying dates & times. • I have a DATE column ("Date & Time") also including TIME in a 12-hr format • I have a DURATION column ("Duration") • I set up an automation from Airtable to Slack when a new event is created, but the Date & Time displays weird (supposed to be "2/21/2023, 1:00pm" but comes out as "2023-02-21T180000.000Z") • I want to create a new FORMULA column that pulls info from DATE and DURATION that displays info as "Feb 21, 1-2pm ET". ◦ I have been troubleshooting with ChatGPT and it's not working • Maybe I could just update it to be a text-based column, but I have it connected to a Google Calendar and would love to keep it that way
d
Your long date is an ISO 8601 date format and probably just needs to be reformatted when its ingested. That DATETIME field is probably stored as an Epoch timestamp, which may or may not matter. If you want to use a formula field in Airtable, try this one:
CONCATENATE(DATETIME_FORMAT(Date,'MMM D'),", ",DATETIME_FORMAT(Date,'h'),"-",DATETIME_FORMAT(DATEADD(Date,Duration, 'seconds'),'h:mm A'))
image.png
I had to set the date field to use the same timezone for all collaborators. You can set timezone in the formula field if you want.
a
@Drew Claybrook this is the closest I've gotten!! Duration is correct but it's not registering the time correctly.
d
Did you adjust the Date column setting to “Use the same time zone for all collaborators?”
👍 1
If you want everything in EST/EDT, you can force it:
CONCATENATE(DATETIME_FORMAT(SET_TIMEZONE(Date,'America/New_York'),'MMM D'),", ",DATETIME_FORMAT(SET_TIMEZONE(Date,'America/New_York'),'h'),"-",DATETIME_FORMAT(DATEADD(SET_TIMEZONE(Date,'America/New_York'),Duration, 'seconds'),'h:mm A'))
There may be a way to inherit the timezone, but I didn’t see it. Never used airtable before now 😬😆. I just assumed it was a lot like Excel.
a
YOU DID IT!!!!
thank you thank you thank you
d
Awesome! You’re welcome! Now lets see if your automation brings it over properly. That formula column should just be text at this point, which I imagine will work as expected.
a
It didn't at first, but I just re-tested and it works
d
🤘
DrewGPT over here haha
🤪 1
😂 2
‼️ 1
a
hahah love this exchange so much. Thanks @Drew Claybrook for coming fresh in here and helping out cc @Sharon Huey 😄
😊 1
🙌🏼 1
s
I'm a Drew-fan!! 😁
😎 1
a
SOOOO helpful!! I just cannot get around the airtable formula situation. Just so confusing for me.
d
Is there maybe something I can help explain? Or another question to ask?
a
Not right now, but I will certainly be asking you in the future if anything else comes up!
☝️ 2
2