TIME field formatting

Asked

Viewed 32 times

0

I have the following given in the bank 55:42:55 and I need to make it more readable this way 2d7h42m how could I do this formatting?

  • 3

    Fundamental [Dit] the question and explain which type of field used, makes a difference in this case. The normal would be a time field or numeric, and the formatting be done in the client language, if any, and not in SQL. If it’s string, you already need to convert.

  • Seria this here ?

  • @rray not exactly...

  • 1

    @Bacco well, this result is a seconds conversion with SEC_TO_TIME so probably the field is a varchar... In case there was a way to humanize seconds directly into this format %Dd %Hh %Mm would also solve

  • @rray your example is specific to php, I need the result to exit pre-formatted from the database.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.