Gunnar,
   I checked and find that I do have the Time::Local module installed

The problem is ... how do I increment the day from start to end of the
calendar year?

If i initially set nextday to: 2007/01/01 how do i easily increment
this?

Thanks

>>> Gunnar Hjalmarsson <[EMAIL PROTECTED]> 11/20/2007 4:49 PM >>>
Tom Phoenix wrote:
> On 11/20/07, Gerald Wheeler <[EMAIL PROTECTED]> wrote:
>> No (access to) modules available other than what comes with the
basic
>> perl installation.
>> 
>> *** I do NOT know how to increment (and format as "2007/01/01") date
so
>> that it crosses over for each new month and know when it is a leap
year.
> 
> That's a non-trivial problem.

Not too complicated either. This piece of code may or may not help the

OP move forward:

     use Time::Local;

     sub nextday {
         my ($y, $m, $d) = split /\//, shift;
         my $t = timegm 0, 0, 0, $d, $m-1, $y;
         ($d, $m, $y) = ( gmtime($t+24*60*60) )[3..5];
         sprintf '%d/%02d/%02d', $y+1900, $m+1, $d;
     }

     print nextday('2007/11/20');

Also, Gerald, did you ever answer the questions that Tom asked you in 
http://www.mail-archive.com/beginners@perl.org/msg90026.html ?

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 
http://learn.perl.org/ 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to