Thx japhy, Does exactly what I need it to.
Now all I need is a way to work out the last day of the month. Most of them should be easy, but that damn February... Glenn Cannon [EMAIL PROTECTED] Level II Certified DCI Judge 'There is no spoon.' www.eventsbeyondbelief.com > -----Original Message----- > From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]] > Sent: Thursday, November 15, 2001 1:49 PM > To: Glenn Cannon > Cc: [EMAIL PROTECTED] > Subject: Re: Day of the month > > > On Nov 15, Glenn Cannon said: > > >Given the month and the year, how can I derive what day the > first landed on? > > Using the standard Time::Local module, and the built-in > localtime() function. > > use Time::Local; > use strict; > > my ($mon, $year) = (11, 2001); > my $first = timelocal(0,0,0, 1, $mon-1, $year-1900); > > my $dow = (localtime $first)[6]; > my $day = (qw( Sun Mon Tues Wednes Thurs Fri Satur ))[$dow] . "day"; > > -- > Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ > RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ > ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]