in reply to RE: Calculating date from a fixed point
in thread Calculating date from a fixed point
To keep the formatting you can use sprintf. (printf, "is equivalent to print FILEHANDLE sprintf(FORMAT, LIST), except that $\ ... is not appended").
So your code would now look like this. :
use Date::Calc qw/Add_Delta_Days/; my $delta = 72583; my ($year,$month,$day) = Add_Delta_Days(1800,12,28,$delta); $newdate = sprintf("%4d%02d%02d", $year, $month, $day); print "$newdate\n";
-enlil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: RE: Calculating date from a fixed point
by aschroh (Novice) on Apr 17, 2003 at 22:03 UTC |