|
|
Getting the days of a month
|
|
|
|
Forum Regular
Join Date: May 2003
Location: J�mtland - Sweden
Status:
Offline
|
|
hi there!
I am working with a calendar like page..
But I have one problem. How can I figure out the first and last days of a month (and the days in between^^) and specially if it is a... ...hmm, don't have the english word for it... the years that have an extra day^^ in swedish we call it "skott�r" (shotyear, heh)... You know waht I mean =)
well, I need all help I can get^^
|
Mighty3k @ #MacNN
|
|
|
|
|
|
|
|
Senior User
Join Date: Mar 2002
Location: Chicago, IL
Status:
Offline
|
|
Are you writing a dynamically generating calender using some language? That's kind of important, if so, which one?
Years with an extra day are called "leap years" here in the US.
|
We need less Democrats and Republicans, and more people that think for themselves.
infinite expanse
|
|
|
|
|
|
|
|
Forum Regular
Join Date: May 2003
Location: J�mtland - Sweden
Status:
Offline
|
|
Oh, how dumb can I be.
Yes I am, and I am using PHP.
Heh, I found that out later^^
|
Mighty3k @ #MacNN
|
|
|
|
|
|
|
|
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status:
Offline
|
|
Check out the date() function. A few you're interested in:
L - Whether it's a leap year - 1 if it is a leap year, 0 otherwise.
t - Number of days in the given month - 28 through 31
Use like:
$leap_year = date('L');
$num_days = date('t');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|