Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Format Dates for Email Action

Topic Labels: Automations
Solved
Jump to Solution
3510 3
cancel
Showing results for 
Search instead for 
Did you mean: 

When inserting a Date field in an Email Action, the Date and Time format I’ve set within the table does not get used. Instead, I get the default formatting, something like: 2020-06-07T01:00:00.000Z. I’d like the date and time to be outputted in a more readable format in emails, something like 6/7/2020 at 1:00am.

1 Solution

Accepted Solutions

Welcome to the community, @Jerry_Chan!

As you’ve discovered, the automations won’t pull the date formatting directly from the date field itself.

But there’s an easy fix, and this also gives you a lot more flexibility than what a date field can give you. :slightly_smiling_face:

Your solution is to simply create a formula field where you format the date in whatever way you’d like, using the DATETIME_FORMAT function.

So in your case, your formula would look like this:

DATETIME_FORMAT({Your Date Field},'M/D/YYYY \at h:mma')

The only tricky part here is that I had to put the backslash character before the letter “a” in the word “at”, because that “escapes” the character, meaning that it will output exactly as I typed it in.

Otherwise, without the backslash character, that “a” would have turned into “am” or “pm”. And that’s because the letter “a” is one of your formatting specifiers for the DATETIME_FORMAT function.

Once you build your formula, then you can just reference that formula field inside your email action, instead of referencing your original date field.

See Solution in Thread

3 Replies 3

Welcome to the community, @Jerry_Chan!

As you’ve discovered, the automations won’t pull the date formatting directly from the date field itself.

But there’s an easy fix, and this also gives you a lot more flexibility than what a date field can give you. :slightly_smiling_face:

Your solution is to simply create a formula field where you format the date in whatever way you’d like, using the DATETIME_FORMAT function.

So in your case, your formula would look like this:

DATETIME_FORMAT({Your Date Field},'M/D/YYYY \at h:mma')

The only tricky part here is that I had to put the backslash character before the letter “a” in the word “at”, because that “escapes” the character, meaning that it will output exactly as I typed it in.

Otherwise, without the backslash character, that “a” would have turned into “am” or “pm”. And that’s because the letter “a” is one of your formatting specifiers for the DATETIME_FORMAT function.

Once you build your formula, then you can just reference that formula field inside your email action, instead of referencing your original date field.

Welcome to the Airtable community!

To add on to ScottWorld’s advice, the date/time will be in GMT time, unless you also set the timezone with the SET_TIMEZONE function.


DATETIME_FORMAT(SET_TIMEZONE({date/time field}, 'Australia/Sydney'), 'M/D/YYYY h:mm')

Thanks for the additional catch, @kuovonne!! :cowboy_hat_face: :raised_hands: