Help

Re: Convert 24 hr time to 12 hr format

Solved
Jump to Solution
3760 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Sparkn_AI
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi All,

Simple one but I’m a but stuck… so it’s ask questions time.

help

As per above I’m trying to convert the simple 24 hr formatted column into JUST a h:mmA format. My formula is:

DATETIME_PARSE({Confirmed Time - 24 Hr}, “h:mmA”)

How do I stop it showing the date portion (11/19/2020) in my result?

EDIT: Here are my full fields.

extra

Ultimately I’d love to create a single output that combines ‘Confirmed Meeting …’ with ‘Confirmed Time - h:mmA’ (eg November 19, 2020 at 2:00pm) that can be used in as a simple trigger in a Send Email automation on Airtable… I’m just getting my head and logic brain around Airtable though.

1 Solution

Accepted Solutions

Yes, I think I’ve got a potential solution for you. First I would like to mention that including a date field with the time toggled in a form does give the user the ability to select a time in 30 minute intervals like so:

image

If you’d like to continue using eazyfields I think I may have discovered a way to do it.

From your time drop down, create a formula field to get the value of the drop down and multiply by 60 to get the value of your time in seconds.

image

Then, in the formatting for that field, switch the Format to duration.

image

This should give you a duration value for your time. In the picutre below, Time is the selected value and Time value is the actual duration value of the selected time. From there, you can use the above posts/replies to hopefully get the formatting you would like to display the date and time.

image

Hopefully that gets you what you need.

See Solution in Thread

6 Replies 6
Sam_Cederwall
7 - App Architect
7 - App Architect

Welcome to the community.

I think you may just be able to do this way:

DATETIME_FORMAT({Confirmed Time - 24 Hr}, 'h:mmA')

Alternatively, I believe there is a time string formula and that would look like this:

TIMESTR({Confirmed Time - 24 Hr})

Hope this helps. Good luck!

Thanks Sam… both of those options are throwing #ERROR! in my testing. :frowning:

Interesting, sorry, I had the wrong field typed in my answer, any of those formulas should have been used the field {Confirmed Time - h:mmA} instead of the 24 Hr field. That’s my mistake.

I have gone ahead and made a sample table of my own to try and accomplish what you are going for:

image

The Date field is just the date of the meeting.

The time would be the 24 hour clock time of the meeting.

The Scheduled Date / Time field uses a DATEADD formula: DATEADD({Date}, {Time 24 Hour Clock}, 'seconds')

The TIME field uses the TIMESTR formula: TIMESTR({Scheduled Date / Time})

Finally the Meeting field does CONCATENATE(DATETIME_FORMAT(Date,'M/D/YYYY')," at ",TIME)

Hopefully this gives you some clarity and ways you might be able to accomplish what you want. Sorry if this isn’t exactly what you are looking for.

Good luck.

P.S. The reason that you need to seconds in the DATEADD formula is because the 14 hours is in a duration field and the actual value is stored as 14 times 3600, which is what 14 hours is in seconds.

Ahhh! I’ve done my testing and spotted my problem I think. I’m using eazyfields in a form to provide a time selector (easy of use for user etc) and I’m not sure how I convert that text choice into a duration field. Any thoughts?

Yes, I think I’ve got a potential solution for you. First I would like to mention that including a date field with the time toggled in a form does give the user the ability to select a time in 30 minute intervals like so:

image

If you’d like to continue using eazyfields I think I may have discovered a way to do it.

From your time drop down, create a formula field to get the value of the drop down and multiply by 60 to get the value of your time in seconds.

image

Then, in the formatting for that field, switch the Format to duration.

image

This should give you a duration value for your time. In the picutre below, Time is the selected value and Time value is the actual duration value of the selected time. From there, you can use the above posts/replies to hopefully get the formatting you would like to display the date and time.

image

Hopefully that gets you what you need.

Thanks Sam! With a little trial and error I was successful! Thanks for all your help. Let me buy you an e-beer. :beers: