Re: Proposed new package: Time.

From: Date: Fri, 21 Feb 2003 11:31:18 +0000
Subject: Re: Proposed new package: Time.
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-13541@lists.php.net to get a copy of this message
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 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? Leandro Lucarella wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've made a class for managing times that I want to add to PEAR. Simple example: $time =& new Time('20:40'); echo $time->toString()."\n"; $interval =& $time->interval(array(19, 40)); echo $interval->toString()."\n"; $interval->add('0:5:10'); echo $interval->toString()."\n"; var_dump($interval->greater($time)); var_dump($interval->equal(array(1, 5, 10))); Shows: 20:40:00 01:00:00 01:05:10 bool(false) bool(true) Complex example: http://svn.llucax.hn.org:81/svn/hooks/tronco/examples/time.php Source code: http://svn.llucax.hn.org:81/svn/hooks/tronco/lib/Time.php Proposed category: Date and Time Proposed destination: root level (<pear_dir>/Time.php) I'm open to comments/suggestions/+1/-1.... - -- 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
- ------------------------------------------------------------------------ Sin democracia la libertad es una quimera. -- Octavio Paz. (1914-1998) Escritor mexicano. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+VTh7SwIP4LCLT7IRAk0nAKC6W5nqUDd/4lHPD2efpmahfgExAQCfUfjp 3US7CQEqB17nhSkL+lpEN7M= =iAy8 -----END PGP SIGNATURE-----
-- Wolfram ... opensource @ vision:produktion ... http://opensource.visionp.de ... translating template engine .... http://sf.net/projects/simpletpl ... authentication system .... http://sf.net/projects/auth

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