Hi -

Look at Date::Manip on CPAN:

http://search.cpan.org/author/SBECK/DateManip-5.40/Manip.pod

Aloha => Beau.

-----Original Message-----
From: R. Joseph Newton [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 08, 2002 9:07 PM
To: Beginners--Perl
Subject: Standard time and calendar functions for Perl?


Hi,

I feel like I've just spent my afternoon reinventing the wheel.  I'm
working on a Perl script that is highly dependent on relative time, and I
find myself having to create low-level functionality such as:


sub NextMonth {
  my ($Month) = @_;
  %NextMonths = qw(
  Jan Feb
  Feb Mar
  Mar Apr
  Apr May
  May Jun
  Jun Jul
  Jul Aug
  Aug Sep
  Sep Oct
  Oct Nov
  Nov Dec
  Dec Jan);
  return $NextMonths{'$Month'};
}

I've had to write similar functions for detedting leap years, and right
now am holding back from just writing a whole damn library of essential
time.  I wouldn't mind doing this in a separate project if need be, but
it's just distracting as all get out when the subject of my program is
whether to insert a weather closure alert into a weather report page or
pass the page through unchanged.  Essentially, I'm looking for functions
whose signatures, in C++ argot, would resemble:

Date AddDays(Date baseDate, long offset);
Date AddMonths(Date baseDate, long offset);
Date AddYear(Date baseDate, long offset);
Time AddHours(Time baseTime long offset);
Time AddMinutes(Time baseTime long offset);
Time AddSeconds(Time baseTime, double offset);

Is there anything out there like this for Perl?  If they're not, I guess
I'll shrug my shoulders, roll my eyes, and write them myself.  I'd really
like to mone on with my project, though.

Thanks,

Joseph




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to