I am doing a project on symfony and I need to display time with format hours:minutes:seconds from a variable that holds only seconds.
Curretly I have this: $time_in_seconds|date('H:i:s')
And the problem is that it always shows at least 01 hours... and I want it to show 00 if there is no hours present.
Even if I manually do 100|date('H:i:s')
it returns 01:01:40 instead of 00:01:40.
It seems it has something to do with timezones so when I specified +00:00 GMT it fixed it.
$time_in_seconds|date('H:i:s', '+00:00 GMT')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With