Questions about converting seconds to hours

Source: Internet
Author: User
Ask the question of converting seconds to hours & lt ;? Phpechogmstrftime ('% H: % M: % s', 108000 );? & Gt; in this way, we get 06:00:00, which means 30 hours, but this is correct, that is, 20 hours & lt ;? Phpechogmstrftime ('% H: % M: % s', 72000 );? & Gt; questions about converting seconds to hours in blue

The result is 06:00:00, which means 30 hours, but this is correct, that is, 20 hours.


In blue, the administrator replied:
"
Gmstrftime returns a Greenwich Mean Time.
The first is 30 hours. after 24 hours a day is removed, it is 6 hours.
The second is 20 hours, within a day, so it is correct.
This function is not used to convert seconds to hours. within 24 hours, you can barely

"


Finally, how can I convert it to a time of less than 30 hours? For example, if I have 1080000 seconds, how can I get 30: 00: 00? thank you.

------ Solution --------------------
Can it be changed?
$ T = 108000;
Echo floor ($ t/3600). gmstrftime (': % M: % s', $ t); // 30: 00: 00

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.