in reply to Which module for Time?
The DateTime Project aims to solve all date/time processing problems in a single (tho' large!) consistant set of modules.
Here's how to solve your problem with the DateTime modules.
#!/usr/bin/perl use strict; use warnings; use DateTime::Format::Strptime; my $strp = DateTime::Format::Strptime->new(pattern => '%H:%M%P'); my $time = $strp->parse_datetime('8:35am'); $time->add(hours => 1, minutes => 23); print $strp->format_datetime($time), "\n";
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|