Help

DATETIME_FORMAT returning wrong day of week

Topic Labels: Dates & Timezones
Solved
Jump to Solution
2456 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Paul_Miller
6 - Interface Innovator
6 - Interface Innovator

I have {Date} in one column and am trying to list the corresponding day of the week in another column using the following formula:

DATETIME_FORMAT({Date}, “dddd”)

For most of my records, the correct day of the week is returned. However, I have at least one record that is returning the wrong date. December 7, 2019 is a Saturday according the the calendar but AirTable is calculating the day of the week as Sunday.

Very strange. Any help or insight would be appreciated.

1 Solution

Accepted Solutions

Welcome to the community, @Paul_Miller! :grinning_face_with_big_eyes: Very possibly a timezone issue, which could be fixed by using the SET_TIMEZONE() function in conjunction with DATETIME_FORMAT(). In your case, the formula would become:

DATETIME_FORMAT(SET_TIMEZONE({Date}, "America/Chicago"), "dddd")

Replace “America/Chicago” with the proper timezone from this list:

See Solution in Thread

3 Replies 3
Paul_Miller
6 - Interface Innovator
6 - Interface Innovator

Just realized that time of day set in {Date} is populating other places as +5h. Timezone issue?

Welcome to the community, @Paul_Miller! :grinning_face_with_big_eyes: Very possibly a timezone issue, which could be fixed by using the SET_TIMEZONE() function in conjunction with DATETIME_FORMAT(). In your case, the formula would become:

DATETIME_FORMAT(SET_TIMEZONE({Date}, "America/Chicago"), "dddd")

Replace “America/Chicago” with the proper timezone from this list:

Thank you so much. This was it exactly.