From: Wagner, David --- Senior Programmer Analyst --- WGO > > [EMAIL PROTECTED] wrote: > > From: sekhar kavuru [mailto:[EMAIL PROTECTED] > >> > >> I need help with a generic function that can give the value of next > >> day Example : 12/31/2005 => 01/01/2006 > >> > >> I want to accomplish this without Cal::Date > > Fine, but by using timelocal and localtime together, you can > generate the point in time and then add 1 day ( 86400 ) to > the point in time to get the next day. By doing that, it > becomes one use statement plus 3 more lines give or take to > get you the next day. You don't have to go through all the > other checks. > > > Are you saying you want to do it without using a date module, or > > without using that particular date module? > > > > Let me give it a quick shot (off-the-cuff and completely untested): > > > > ------------------------------------------------ [ Unnecessarily complex subroutine removed ] > > ------------------------------------------------ > > > > Caveats: > > - This assumes the incoming date is valid > > - There needs to be a few more checks for the leap year, but I'm too > > lazy to look it up right now.
Ack...I didn't even think of that! Using localtime is definitely a better solution. Bowie _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
