Ticket #29991
Question
I have a numeric field which I want to convert to a time format. For example, I want to convert 92510 to 9:25:10. The system operates on the 24 hour clock so we have instances where the number is 131015 and we want to convert to 13:10:15. Because the length varies, I'm guessing we have to start at the left of the field and work our way to the right. How do we break apart the number appropriately and add the colons?
Answer
Informed customer if this field in question is stored as a numeric field, I think the solution to your question is fairly simple and wouldn't involve any sort of SQL concatenation. What I would suggest doing is simply modifying the displayed format on the field (from Field Settings) to display the numeric time as ##:##:## in your application. If this option is not an available format, you can add this option from Admin Menu -> System Management -> Format Codes. Select 'Create a New Format Code' and make sure the Format Description is '#:##:##'.
Asked on February 4, 2020