Skip to main content
Solved

Getting a Timeparse to Recognize 'a' as AM and 'p' as PM

  • April 30, 2020
  • 1 reply
  • 28 views

Forum|alt.badge.img+7

I am currently trying to get by without a dedicated TIME field with no date attached. I am currently trying to convert a text field into a timefield with the following code:

DATETIME_FORMAT(DATETIME_PARSE({Start Time}, ‘hh:mm’), ‘hh:mm a’)

The focumula is working fine, however when I write in a time, such as 3pm, it still parses it in as 3am. I note that if I put in 1500, it correctly parses the time to 3pm.

I have worked in systems where you could put in variations of (3pm, 3p, 300pm, etc) and it would always know that meant PM. Is there a way to make airtable do this, and of course the converse with AM, so that I do not have to use military time?

Best answer by Nate_Sheets

Well holy crap, I figured it out!

DATETIME_FORMAT(DATETIME_PARSE({Start Time}, ‘hh:mmaaa’), ‘hh:mma’)

1 reply

Forum|alt.badge.img+7
  • Author
  • Inspiring
  • Answer
  • April 30, 2020

Well holy crap, I figured it out!

DATETIME_FORMAT(DATETIME_PARSE({Start Time}, ‘hh:mmaaa’), ‘hh:mma’)