Advertisement
Virajsinh

PHP Convert seconds to HH:MM:SS format

Dec 21st, 2022 (edited)
1,390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.14 KB | Source Code | 0 0
  1. // With Landing Zero
  2. $seconds = round($seconds);
  3. $output = sprintf('%02d:%02d:%02d', ($seconds/ 3600),($seconds/ 60 % 60), $seconds% 60);
Tags: php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement