sekhar kavuru wrote:

> 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

use strict;
use warnings;
use Time::Local;

my @t = localtime;                      # get epoch time for today
$t[0] = 0; $t[1] = 0; $t[2] = 12;       # drop H:M:S back to noon
$t[3]++;                                # go forward a day

my $time = timelocal (@t);              # convert to epoch time

# Now you can use one of these for the rest:

@t = localtime $time;
my $file = sprintf "%02u/%02u/%04u", $t[4]+1, $t[3], $t[5]+1900;
print $file, "\n";

use POSIX;
@t = localtime $time;
$file = strftime "%m/%d/%Y", @t;
print $file, "\n";

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to