Greg Schiedler wrote:
> Perl v5.6.1
>
> Trying to easily create some variable based on the current month and
> links to the two previous months. The filename(s) are based on two
> digit months MM--Filename. I have the filename part working but
> I need some guidancd on creating the MM-.
Rob Hanson wrote:
One note... if you have a daylight savings time that takes effect between
11pm and 1am this won't work. In the US DST is 2am, so it is safe.
Also, this might be a prettier solution...
use Time::Local;
use constant DAY => 86_400;
$current = time;
$previous = subtract_month(time, 1
al Message-
From: Hanson, Rob
Sent: Tuesday, September 07, 2004 6:33 PM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: Month-Year Links
The trick is to use Time::Local to find the first day of the month, then
subtract 1 day.
This prints:
09-2004
08-2004
07-2004
###
time = localtime($time);
return sprintf('%02d-%04d', $time[4]+1, $time[5]+1900);
}
-Original Message-
From: Greg Schiedler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 07, 2004 5:01 PM
To: [EMAIL PROTECTED]
Subject: Month-Year Links
Perl v5.6.1
Trying to easily create s
Perl v5.6.1
Trying to easily create some variable based on the current month and links to the two
previous months. The filename(s) are based on two digit months MM--Filename. I
have the
filename part working but I need some guidancd on creating the MM-. I have seen
many
perl modules t