Gossamer Forum
Home : General : Perl Programming :

Getting first day of a month...

Quote Reply
Getting first day of a month...
Hi,

I'm really having trouble with this :(

Basically, I'm trying to build a calendar box, like so:

Code:
August 2007
Mon Tue Wed Thu Fri Sat Sun
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31


(the above is done with Date::Calc::Calendar(2007,8); , but its plain text formatting - and I would rather format it manually into tables/cells etc).

Now, I could do this once I have the following paramaters -

1) The start day
2) The number of days in a given month

The 2nd one, is pretty simple:

my $days = Days_in_Month($year,$month);

..but the 1st one has me stumped.

Does anyone have a good way of working out the day the 1st of a given month falls on?

TIA!

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Getting first day of a month... Andy 14465 Aug 25, 2007, 3:52 AM
Thread Re: [Andy] Getting first day of a month...
Wychwood 14244 Aug 25, 2007, 10:51 AM
Thread Re: [Wychwood] Getting first day of a month...
Andy 14208 Aug 27, 2007, 3:22 AM
Thread Re: [Andy] Getting first day of a month...
nkcsx 14189 Sep 1, 2007, 9:50 AM
Post Re: [nkcsx] Getting first day of a month...
Andy 14189 Sep 1, 2007, 2:32 PM
Thread Re: [Andy] Getting first day of a month...
pavithra.bt 13469 Jan 29, 2009, 12:21 AM
Post Re: [pavithra.bt] Getting first day of a month...
Andy 13437 Jan 29, 2009, 12:34 AM
Post Re: [pavithra.bt] Getting first day of a month...
cjf 13227 Mar 3, 2009, 11:50 PM
Post Re: [Wychwood] Getting first day of a month...
Andy 14205 Aug 28, 2007, 1:17 AM