All Collections
Help Articles
Apricot Results Reporting (ARR)
ARR Functions and Formulas
Apricot Results | Converting 24 hour time to 12 hour time
Apricot Results | Converting 24 hour time to 12 hour time

How to convert military/24 hour time formats to a 12 hour format

Updated over a week ago

If a form with a time capture field is set to military/24 hour time formats, it may be necessary to convert those times to a 12 hour time format for reporting purposes.

Create a variable using the following formula for each time capture field in your form, making sure to replace [Time Field_XX] with the object from your query:

  • =(If Left([Time Field_XX];2)="00" Then 12 ElseIf Left([Time Field_XX];2) Between ("13";"23") Then (ToNumber(Left([Time Field_XX];2))-12) Else ToNumber(Left([Time Field_XX];2)) ) + Substr([Time Field_XX];3;6) + (If Left([Time Field_XX];2) Between ("13";"23") Then " PM" Else " AM")

Did this answer your question?