Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Lib.Time.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Set of usefull Time functions
9  *
10  * @author Anakeen 2000
11  * @version $Id: Lib.Time.php,v 1.2 2003/08/18 15:46:42 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage CORE
15  */
16 /**
17  */
18 // ---------------------------------------------------------------
19 // $Id: Lib.Time.php,v 1.2 2003/08/18 15:46:42 eric Exp $
20 // $Source: /home/cvsroot/anakeen/freedom/core/Share/Lib.Time.php,v $
21 // ---------------------------------------------------------------
22 function hour2sec($h = 0, $m = 0, $s = 0)
23 {
24  return (($h * 3600) + ($m * 60) + $s);
25 }
26 
27 function sec2hour($s, &$H, &$M, &$S)
28 {
29  $H = ($s / 3600);
30  settype($H, "integer");
31  $M = (($s % 3600) / 60);
32  settype($M, "integer");
33  $S = ($s - ($H * 3600) - ($M * 60));
34  settype($S, "integer");
35  if (strlen($H) == 1) $H = "0{$H}";
36  if (strlen($M) == 1) $M = "0{$M}";
37  if (strlen($S) == 1) $S = "0{$S}";
38 }
39 ?>
← centre documentaire © anakeen - published under CC License - Dynacase