RE: [PHP] First day of the month
| From: | Vail, Warren | Date: | Tue, 03 Aug 2004 18:09:12 +0000 |
| Subject: | RE: [PHP] First day of the month | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-192571@lists.php.net to get a copy of this message | ||
I was going to suggest;
$dayofweek = date("D",strtotime(date("Y-m-01")));
Warren Vail
-----Original Message-----
From: John Nichel [mailto:john@kegworks.com]
Sent: Tuesday, August 03, 2004 11:00 AM
To: php-general@lists.php.net
Subject: Re: [PHP] First day of the month
On Tuesday 03 August 2004 13:46, David Hansen Jr. offered up the following
tid-bit of information :
> I'm trying to make a custom calendar script for my school district,
> and I'm hitting a little obstacle. I know how I can accomplish what
> I'm after, but it's a lot of extra coding. I'm wondering if there's a
> simple way to figure out what day of the week the first day of the
> month lands on. I can take the info pulled with date() and use
> several
> switch() and if statements, but that's ugly. Anyone have any
> suggestions?
>
> Thanks!
> ~ David
$firstDayOfMonth = mktime (0,0,0, $month, 1, $year );
http://us4.php.net/mktime
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john@kegworks.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php