in reply to Values of day and month in two digets
I suggest that the call to Data::Calc::Add_Delta_Days is not necessary, as subtracting 86_400 (number of seconds in a day) from time is guaranteed to yield 'yesterday', regardless of the time of day. I use:
#!/usr/bin/perl -w use strict; my ($d, $m, $y) = (localtime (time-86_400)) [3..5]; printf "%04d%02d%02d\n", $y+1900, $m+1, $d;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Values of day and month in two digets
by chromatic (Archbishop) on Mar 12, 2004 at 06:42 UTC | |
by DrHyde (Prior) on Mar 12, 2004 at 08:36 UTC |