DateTime::Set - Number of elements in set

2003-08-17 Thread Rick Measham
Flavio, is there already a method to determine the number of elements in a DateTime::Set? If not, I can currently make it as_list, and then get the length of the list, but it would be cleaner to have a method to do this. Cheers! Rick

[ANNOUNCE] DateTime::Event::Easter 1.02

2003-08-17 Thread Rick Measham
The new Event-Easter has been uploaded to CPAN and should be available shortly. This release fixes the issue raised by Ron Hill concerning sets. Basically sets weren't being tested so the problem never showed its head. The sets test was just a duplicate of the lists test! All fixed now though! Che

Subtraction Broken?

2003-08-17 Thread Matthew McGillis
I'm not sure if I'm doing something really wrong or if things are broke but with this code: #!/usr/bin/perl use DateTime; $birth=DateTime->new(year=>1968,month=>6,day=>28); print $birth->ymd."\n"; $today=DateTime->today; print $today->ymd."\n"; $age=$today-$birth; print $age->years."\n"; I get

Re: DateTime::Set - Number of elements in set

2003-08-17 Thread fglock
> Flavio, is there already a method to determine > the number of elements in a DateTime::Set? > > If not, I can currently make it as_list, and then > get the length of the list, but it would be > cleaner to have a method to do this. What would be a name for this method? There is no accessor ye

Re: DateTime::Set - Number of elements in set

2003-08-17 Thread Flavio Glock
--- Rick Measham <[EMAIL PROTECTED]> wrote: > Flavio, is there already a method to determine the > number of elements in > a DateTime::Set? > > If not, I can currently make it as_list, and then > get the length of the > list, but it would be cleaner to have a method to do > this. There is an in

Re: Subtraction Broken?

2003-08-17 Thread Joshua Hoblitt
Hi Mattew, > $birth=DateTime->new(year=>1968,month=>6,day=>28); > print $birth->ymd."\n"; > $today=DateTime->today; > print $today->ymd."\n"; > $age=$today-$birth; > print $age->years."\n"; $age is a DateTime::Duration object. Unfortunately math with these object can be a little non-intuitive.

Re: DateTime::Set - Number of elements in set

2003-08-17 Thread Rick Measham
On Mon, 2003-08-18 at 02:37, [EMAIL PROTECTED] wrote: > > Flavio, is there already a method to determine > > the number of elements in a DateTime::Set? > > > > If not, I can currently make it as_list, and then > > get the length of the list, but it would be > > cleaner to have a method to do thi

Re: Subtraction Broken?

2003-08-17 Thread Joshua Hoblitt
> Again I fail to see the logic or even value in the DateTime::Duration > behaving as above. But, I'm sure I'm probably just missing something > important. Durations are independent of dates and times. > The only one that does makes since is Deltas but only > because it is returning a hash that h

Re: Subtraction Broken?

2003-08-17 Thread Matthew McGillis
Try: print $age->deltas, "\n"; If the output from that doesn't look right to you please send it on to the list. Code (DateTime is the current version available from CPAN): #!/usr/bin/perl use DateTime; $birth=DateTime->new(year=>1968,month=>6,day=>28); print $birth->ymd."\n"; $today=DateTime-

Re: Subtraction Broken?

2003-08-17 Thread Matthew McGillis
> Perhaps I'm just approaching this all wrong. I'm just looking for a simple way to compute some ones age today. What you want is to normalize the values of a duration relative to some fixed point in time. I agree this is something that we need to do. Patches are welcome. :) So if I read this