Guest User

PHP Convert

a guest
Apr 10th, 2017
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1. function czasNaGodziny($seconds) {
  2.         $d = floor($seconds/(3600*24));
  3.         $seconds = $seconds % (3600*24);
  4.         $h = floor($seconds/3600);
  5.         $seconds = $seconds % 3600;
  6.         $m = floor($seconds/60);
  7.         $seconds = $seconds % 60;
  8.         echo "$d dni, $h godzin, $m minut, $seconds sekund";
  9.     }
  10.  
  11. czasNaGodziny(czas w sekundach);
Advertisement
Add Comment
Please, Sign In to add comment