in reply to how to find out the date 'Tuesday' for this week
--use POSIX 'strftime'; # get today my $today = time; # get current day of week my $dow = (localtime($today))[6]; # get last Sunday (day 0) my $sunday = $today - (86_400 * $dow); # get Tuesday (day 2) my $tuesday = $sunday + (86_400 * 2); # print Tuesday in a nice format print strftime "Tuesday is %d %B %Y\n", localtime $tuesday;
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: how to find out the date 'Tuesday' for this week
by no_slogan (Deacon) on Sep 04, 2002 at 14:48 UTC | |
by davorg (Chancellor) on Sep 04, 2002 at 16:55 UTC |