Return to Snippet

Revision: 11103
at January 24, 2009 02:55 by optimal


Initial Code
$minutes = 3000;
//
// Assuming that your minutes value is $minutes
//
$d = floor ($minutes / 1440);
$h = floor (($minutes - $d * 1440) / 60);
$m = $minutes - ($d * 1440) - ($h * 60);
//
// Then you can output it like so...
//
echo "{$minutes}min converts to {$d}d {$h}h {$m}m";

Initial URL


Initial Description
So. You have some minutes and want a "human readable" version? Sure thing baby!

Initial Title
Convert Minutes to Human Readable Days / Hours / Minutes

Initial Tags
convert

Initial Language
PHP