in reply to Simple date calc
You can extract month/day/year from that string, or use the more general list context version and do the processing yourself:my $yesterday = localtime (time - 86400);
my @yesterday_values = localtime(time - 86400);
This works by getting us back to roughly midnight today, then going back another 12 hours. Even if the day is 23 or 25 hours, this'll still be within the mid-day span.my $current_hour = (localtime)[2]; my $yesterday_around_noon = localtime(time - ($current_hour + 12) * 36 +00);
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: •Re: Simple date calc
by aennen (Acolyte) on Dec 19, 2002 at 18:30 UTC |