DateTime.pm and midnight
- From: Arvin Portlock <nomail@xxxxxxxxx>
- Date: Thu, 29 Dec 2005 15:38:14 -0800
Why does the following code return 0 minutes instead of 60?
use DateTime; use DateTime::Duration;
my $year = 1969; my $month = 4; my $day = 2; my $hour = 23;
my $datetime = new DateTime (year => $year,
month => $month,
day => $day,
hour => $hour);my $onehour = new DateTime::Duration (hours => '1');
my $elevenpm = new DateTime (year => $year,
month => $month,
day => $day,
hour => '23');my $midnight = $elevenpm + $onehour;
my $delta = $midnight - $datetime; print $delta->minutes, "\n";
.
- Follow-Ups:
- Re: DateTime.pm and midnight
- From: J. Gleixner
- Re: DateTime.pm and midnight
- Prev by Date: Parsing javascript with html::tokeparser
- Next by Date: Re: how to convert the characters ASCII(0-255) to ASCII(0-127)
- Previous by thread: Parsing javascript with html::tokeparser
- Next by thread: Re: DateTime.pm and midnight
- Index(es):