Re: Proposed new package: Time.
| From: | Pierre-Alain Joye | Date: | Fri, 21 Feb 2003 13:56:05 +0000 |
| Subject: | Re: Proposed new package: Time. | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-13551@lists.php.net to get a copy of this message | ||
On Fri, 21 Feb 2003 10:41:54 -0300
Leandro Lucarella <luca@llucax.hn.org> wrote:
> I'm sorry about my english but I don't know what a "time span manager"
> is.
A span represent a distance, in this case, a time distance, the span
between 14:00 and 15:30:23 is 1:30:23.
> I think I understand what you mean. Is something like this, but
> simpler, if you continue, you can add months and years too :)
I do not think years/months should be added too, except if you define a
default month/year length. Usually, the span is defined as
days,hours,mins and seconds. For instance, you can take a look to the
different Date/Time packages in python, perl, or C/C++ APIs.
> This is not the idea. The reason for this package is I want to count
> worked hours, so the original class was made just for 24hs, but to
> count time intervals, not to see what day/time is. I thought it could
> be helpfull to add support for 24hs+ but just if other people need it
> and if I doesn't means to add much complexity to the class.
Let see, worked hours mean a list of time span, no ? If I work from 8:00
to 12:00 and from 13:00 to 17:00, I got 2 timespan (worked hours), of
4:00:00. Is that not the same thing ?
> Mmm, I don't understand what Time Span is again? I thought is like
> counting Time intervals?
> Anyway, I think I can make the class to support 24hs+ and add some
> methods like setFromDays(), setFromMonths(), setFromYears() (too much?
> :) and toDays(), toMonths(), toYears().
> But as with the other setFromXxx() and toXxx() methods, quantities are
> float values (like 1.23 months and 0.12 years).
hmm dunno if it is usefull to set values using this scheme, humans are
not smart with decimal based time :), but it may be possible to add
different set methods.
+1 to add it to Date, with additionnals features if needed (see
Wolfgang and Lukas posts).
pierre