SpellsBook

 +PHP
+ Adobe Flash 2 0 (0)
+ Arrays (4)
+ COM for Windows (2)
+ Image (2)
+ LDAP (3)
+ MySQL (11)
+ Regular Expressions (2)
+ String Manipulation (12)
+ Time and Date (6)
+ Date Format
+ Hours to Minutes
+ Minutes to Hours
+ Past Present Future
+ String to Date
+ Today
 +Snippet Options
+   Printer Friendly
 +Library Options
+   View Other Library
Adobe_Flash_3_0
C_Plus_Plus
Debian_Install
Del_me_Soon
HTML_and_CSS
JavaScript
Linux_Commands
PHP
 +General Options
+   Library Home
+   PHP-CSL Credits
+   PHP-CSL License
+   Resource Links
+   Log in
Syntax for: Time and Date / Minutes to Hours

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:

<? 

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;
}
?>
 
Description for: Time and Date / Minutes to Hours
  Convert minutes to hours.


 
Powered by: PHP-CSL V0.9