Glenn Cannon wrote:
>
> 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...
>
It's always the best using an already existing module.
E.g. Date::Calc:
use Date::Calc qw(Days_
On Nov 15, Adam Turoff said:
>Find the first day of the next month (remember december/january rollover)
>and subtract one day:
> my ($mon, $year) = (11, 2001);
> my $first = timelocal(0,0,0, 1, $mon % 12, ($year-1900 + int($mon/12)));
You'll probably want to use noon if you're going to subtra
Heheh yeah for the day name only (not the actual date number) it's the
way to go!!
Way faster
Etienne
Adam Turoff wrote:
>
> On Thu, Nov 15, 2001 at 03:08:48PM -0500, Glenn Cannon wrote:
> > Now all I need is a way to work out the last day of the month. Most of them
> > should be easy, but th
On Nov 15, Glenn Cannon said:
>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...
Just find out the FIRST day of the month AFTER it, and subtract one.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~j
On Thu, Nov 15, 2001 at 03:08:48PM -0500, Glenn Cannon wrote:
> 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...
Find the first day of the next month (remember december/january rollover)
and subtract one day:
## hacking ja
lief.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
> >
> >
&g
-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 t
Do something like:
use Time::Local; # part of std perl
my $MySecs = timelocal( 0, 0, 12, 1, $month-1, $year );
# ^--- seconds
# ^--- minutes
#^--- hours
# Note
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,