Re: Proposed new package: Time.
| From: | Wolfram Kriesing | Date: | Fri, 21 Feb 2003 13:33:31 +0000 |
| Subject: | Re: Proposed new package: Time. | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-13548@lists.php.net to get a copy of this message | ||
Leandro Lucarella wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Wolfram Kriesing, el viernes 21 de febrero a las 12:31 me escribiste:i dont know if i understand it wrong or if i misexplained it. i mean converting a decimal number of hours, like 2.5 hours (2 and a half hours) to the "hour format" which would be 2:30 (2 hours and thrity minutes) and alikes -- Wolfram ... opensource @ vision:produktion ... http://opensource.visionp.de ... translating template engine .... http://sf.net/projects/simpletpl ... authentication system .... http://sf.net/projects/authsince i can not open the files i am still waiting ... but i am definitely interested too. but i would like to see the code, to see if something like converting 2,0 h to 02:00 3,5 h to 03:30The string conversions uses strtotime(), I don't think it works with string "import", but you can use another methods like (from the complex example): $t['pi_h'] =& new Time(); $t['pi_h']->setFromHours(pi()); $t['pi_m'] =& new Time(); $t['pi_m']->setFromMinutes(pi()); $t['pi_s'] =& new Time(); $t['pi_s']->setFromSeconds(pi()); Prints: 03:08:30 00:03:08 00:00:03