PHP time format conversion duration:
Read: ["time"] => string (3) "224"
Seconds
How to display it on the page: 3.7333333333333 seconds
How to convert it?
Reply to discussion (solution)
Look at the number_format () function.
Look at the number_format () function.
-----------------------------------
Seconds
Display:
224 seconds
No!
Duration:
Read: ["time"] => string (3) "224"
Seconds
How to display it on the page: 3.7333333333333 seconds
How to convert it?
I don't understand. What is your $ value ['Time'] unit? Millisecond? No.
If it is a second, divide it by 60. why?
What kind of format do you want to convert?
Look at the number_format () function.
-----------------------------------
Seconds
Display:
224 seconds
No!
I followed the prompts in your code.
What is 224? What do you want to display? 224/60 = 3.733 ...... If not, it makes no sense in mathematics ......
What is the database time field type?
$ Value ['Time'] = 224; echo $ value ['Time']. "seconds
"; Echo ($ value ['Time']/60 )."
"; Echo round ($ value ['Time']/60, 2 )."
";
224 seconds
3.7333333333333 points
3.73 points
Echo gmdate ('H: I: S', 224); // 00:03:44