Re: date -> day
| From: | David Robley | Date: | Tue, 26 Jun 2001 01:48:37 +0000 |
| Subject: | Re: date -> day | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-55197@lists.php.net to get a copy of this message | ||
On Tue, 26 Jun 2001 00:28, Tyler Longren wrote:
> Hello,
>
> I have something like this:
> $Month = "6";
> $Year = "2001";
> $Date = "1";
>
> Is there any relatively simple way to get the day out of that? For
> example, the day for 6-1-2001 would be Friday.
>
> Thanks,
> Tyler
If that info comes from a database, the db might have date formatting
capabilities that you could use.
Otherwise, mktime and date would do:
$dayofweek = date("l", mktime(0,0,0,$Month, $Date, $Year))
Or you could use getdate instead of date to populate an array of
interesting values :-)
Have a look at the date functions for more exciting possibilities.
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
Birds are trapped by their feet, people by their tongues.