# Any joy turning 12 hour time to 24?

**URL:** https://community.glideapps.com/t/any-joy-turning-12-hour-time-to-24/30194
**Category:** Ask for Help
**Tags:** custom-code
**Created:** [August 8, 2021, 8:57pm UTC](https://community.glideapps.com/t/any-joy-turning-12-hour-time-to-24/30194 "2021-08-08T20:57:26Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)
#### Post date: [August 8, 2021, 8:57pm UTC](https://community.glideapps.com/t/any-joy-turning-12-hour-time-to-24/30194/1 "2021-08-08T20:57:26Z")

</div>

I have @Mark 's HYC code, and I am trying to turn 12:00 PM or 08:30 PM into nice 24 hour time (so 12:00 or 20:30).

I am using the Excel formula : **=TEXT(A1,”HH:MM:SS”)**  
and this is seemingly supported on HyperFormula ([Built-in functions | HyperFormula (v2.6.0)](https://handsontable.github.io/hyperformula/guide/built-in-functions.html#list-of-available-functions))

- but no joy so far.

Has anyone else managed this? Thanks! M

---

<div class="post-metadata">

### Author: ![SantiagoPerez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/santiagoperez/32/16807_2.png) [@SantiagoPerez](https://community.glideapps.com/u/SantiagoPerez)
#### Post date: [August 8, 2021, 9:49pm UTC](https://community.glideapps.com/t/any-joy-turning-12-hour-time-to-24/30194/2 "2021-08-08T21:49:24Z")

</div>

Hola @Mark_Turrell

This may not be the most beautiful way but I think it works.

You need to first turn your time into a string (template column)

 ![Screen Shot 2021-08-08 at 4.44.52 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/0/204ff64b45b536e631ba0bfa3d905ef4d17e21d1.png)

The use the Excel Formula code in a YC and add this formula: =TEXT(A1,"[hh]:mm:ss")

 ![Screen Shot 2021-08-08 at 4.45.04 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/4/e401518933c16b5ae59e8d7d2d928f722baa74e9.png)

---

<div class="post-metadata">

### Author: ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)
#### Post date: [August 8, 2021, 9:59pm UTC](https://community.glideapps.com/t/any-joy-turning-12-hour-time-to-24/30194/3 "2021-08-08T21:59:02Z")

</div>

Perfect 🙂 I like the trick of using the template column to turn the ‘primitive’ value into text 🙂 🙂 Thanks - everything is working now 🙂 ⭐ 🌟

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [August 8, 2021, 10:30pm UTC](https://community.glideapps.com/t/any-joy-turning-12-hour-time-to-24/30194/4 "2021-08-08T22:30:45Z")

</div>

Did it not work because Mark had the full date & time under the hood, instead of a text field like you did with the template?

---

<div class="post-metadata">

### Author: ![SantiagoPerez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/santiagoperez/32/16807_2.png) [@SantiagoPerez](https://community.glideapps.com/u/SantiagoPerez)
#### Post date: [August 8, 2021, 10:31pm UTC](https://community.glideapps.com/t/any-joy-turning-12-hour-time-to-24/30194/5 "2021-08-08T22:31:28Z")

</div>

I don’t really know but I guess that was the reason.

---

<div class="post-metadata">

### Author: ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)
#### Post date: [August 8, 2021, 10:39pm UTC](https://community.glideapps.com/t/any-joy-turning-12-hour-time-to-24/30194/6 "2021-08-08T22:39:04Z")

</div>

The Yes-code did not want to process the value as it came in, so a detour through an extra column to make it a text string with the template allowed it to be handled properly with the excel formula.

---

<div class="post-metadata">

### Author: ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)
#### Post date: [August 8, 2021, 10:54pm UTC](https://community.glideapps.com/t/any-joy-turning-12-hour-time-to-24/30194/7 "2021-08-08T22:54:00Z")

</div>

this is my solution for time formats, instant check if a business is open, AM/PM - 24H switch, with no YC or any script used: [SAMPLE](https://business-time-picker.glideapp.io/)

[![Screen Shot 2021-08-08 at 6.52.09 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/a/ca93ac8c4ee95175452b6b0187aef0bfce198837.png)](https://business-time-picker.glideapp.io/)
