Skip to main content
Solved

DATETIME_FORMAT returning wrong day of week

  • November 6, 2019
  • 3 replies
  • 39 views

Paul_Miller
Forum|alt.badge.img+10

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.

Best answer by Justin_Barrett

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:

3 replies

Paul_Miller
Forum|alt.badge.img+10
  • Author
  • Known Participant
  • November 6, 2019

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


Justin_Barrett
Forum|alt.badge.img+21
  • Inspiring
  • Answer
  • November 7, 2019

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:


Paul_Miller
Forum|alt.badge.img+10
  • Author
  • Known Participant
  • November 7, 2019

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.