Hi All,

I guess the subject says it all. I would like to be able to change
the max and min values that are in a DateTine Set object. Here is a test
script that demonstrates my problem.


use strict;
use warnings;
use DateTime;
use DateTime::Set;
use DateTime::Duration;

#generate a monthly set object that has min set to the first day of the month
# max set to last day of the month

my $dt_set = DateTime::Set->from_datetimes(
    dates => [
        DateTime->today->truncate( to => 'month' )->subtract( months => 1 ),
        DateTime->last_day_of_month(
            year  => DateTime->today->year,
            month => DateTime->today->subtract( months => 1 )->month
          )
    ]
);
# ok goo so far now I need to add 23 hours and 50 min to the 
# max value

my $dt = DateTime::Duration->new( hours=>23, minutes =>50);

$dt_set->max->add($dt);

print $dt_set->max->datetime;

This prints 2004-10-31T00:00:00
I was expecting 2004-10-31T23:50:00

How can I get the Max value of the set object to represent
what I was expecting?

Thanks

M
-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm

Reply via email to