Re: Proposed new package: Time.

From: Date: Fri, 21 Feb 2003 13:27:05 +0000
Subject: Re: Proposed new package: Time.
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-13546@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Wolfram Kriesing, el viernes 21 de febrero a las 12:31 me escribiste: > since 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:30 The 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 So, setFromHours() is the method you're looking for. (you have toMinutes(), toSeconds() and toHours() too). > since that is something i am also looking for > another thing that i could imagine is converting hours to > days/months/year, this is interesting for example, when you say: i > worked 120 hours this month, this is > 120/8 = 15 man days (is it called that way in english?) > or a project took 2 man years which is then calculated into > hours/days/etc. > therefore of course you need to set the ratios, like > 1 d = 8h > 1 year = ?? days ... etc. > > is that of interest or too special? Is not a bad idea, but I think things like this could be done in a sepparate package that uses Time class. I'd like to keep it simple. Again, an alternative URLs: http://www.llucax.hn.org/pear/lib/Time.php http://www.llucax.hn.org/pear/examples/time.php - -- LUCA - Leandro Lucarella - Usando Debian GNU/Linux Sid - GNU Generation - ------------------------------------------------------------------------ E-Mail / JID: luca@lugmen.org.ar GPG Fingerprint: D9E1 4545 0F4B 7928 E82C 375D 4B02 0FE0 B08B 4FB2 GPG Key: gpg --keyserver pks.lugli.org.ar --recv-keys B08B4FB2 - ------------------------------------------------------------------------ El futuro es ese periodo de tiempo en el que prosperan nuestros negocios, nuestros amigos son verdaderos y nuestra felicidad segura. -- Ambrose Bierce. (1842-1914) Escritor estadounidense. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+VikoSwIP4LCLT7IRAo/eAKCJVF1RaqFN4HjemdX4wGlXJQvaOACgjJYA nFk3XZI7ZYdndn9giIl7Ot8= =2fil -----END PGP SIGNATURE-----

« previous php.pear.dev (#13546) next »