Php > Date Time sample source codes
Minutes to Hours
Minutes to Hours function m2h($mins) { if ($mins < 0) { $min = Abs($mins); } else { $min = $mins; } $H = Floor($min / 60); $M = ($min - ($H * 60)) / 100; $hours = $H $M; if ($mins < 0) { $hours = $hours * (-1); } $expl = explode(".", $hours); $H = $expl[0]; if (empty($expl[1])) { $expl[1] = 00; } $M = $expl[1]; if (strlen($M) < 2) { $M = $M . 0; } $hours = $H . "." . $M; return $hours; } ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage