Skip to main content

DATETIME_FORMAT returning wrong time

  • January 6, 2022
  • 7 replies
  • 158 views

Hi there,

I’m using Airtable to log some vitals for my doctor, and, for some reason, DATETIME_FORMAT is returning the wrong times. So, 1:17 becomes 7:17, for example. Here’s my formula:

DATETIME_FORMAT({Auto Date},"M/D/YY - h:m ") & {AM/PM}

Any suggestions would be appreciated! :slightly_smiling_face:

7 replies

Dimitris_Goudis
Forum|alt.badge.img+20

Hey @Alba,

welcome to Airtable community.

You have to update the specifier to have the result you are looking for. Please check the list of specifiers in the guide below:

Yours sincerely,
Dimitris Goudis


  • Author
  • New Participant
  • January 9, 2022

The provided format specifiers didn’t work, so my workaround was to create:

  1. Checkbox field called PM
  2. Formula field to check if the checkbox field is checked [IF({PM},“pm”,“am”)]
  3. Formula primary field that substitutes the insufficient or not working supported format specifiers with whatever’s in the second formula field [DATETIME_FORMAT({Auto Date},"M/D/YY - h:m ") & {AM/PM}]

That worked, but, my gosh…


ScottWorld
Forum|alt.badge.img+35
  • Genius
  • January 10, 2022

Your formula doesn’t look correct to me, but are you in the central time zone? If so, your issue was probably the GMT time zone toggle in one or both of your fields.


  • Author
  • New Participant
  • January 10, 2022

Your formula doesn’t look correct to me, but are you in the central time zone? If so, your issue was probably the GMT time zone toggle in one or both of your fields.


Thanks for the suggestion. It just doesn’t work for me here. Whether GMT is toggled on or off, I’m still getting the wrong time returned.


  • Author
  • New Participant
  • January 10, 2022

Somehow, I’m back at square one here. Why can’t I just make the created time the primary field?


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • January 10, 2022

Somehow, I’m back at square one here. Why can’t I just make the created time the primary field?


Use a formula field for your primary field, with the formula for the created time: CREATED_TIME().


  • Author
  • New Participant
  • January 13, 2022

Use a formula field for your primary field, with the formula for the created time: CREATED_TIME().


That did it! That, along with toggling off the GMT thing in the primary field’s formatting tab. Thanks, kuovonne!