RE: [PHP] Working out the name of the day given a date

From: Date: Tue, 16 Jan 2001 16:30:55 +0000
Subject: RE: [PHP] Working out the name of the day given a date
Groups: php.general 
Request: Send a blank email to php-general+get-34840@lists.php.net to get a copy of this message
Hmmm. I did: $timestamp = mktime(0,0,0,$month,$date,$year); $day = date("1", $timestamp); and it returns 1, no matter what the contents of $month, $date and $year are. Did I miss something? -----Original Message----- From: Andrew Rush [mailto:andy@mainetoday.com] Sent: 16 January 2001 16:03 To: Jon Haworth Subject: Re: [PHP] Working out the name of the day given a date On Tuesday, January 16, 2001, at 10:56 AM, Jon Haworth wrote: > Just a quickie. Does anyone have a code snippet for calculating the day of > the week given a date? I was hoping I could feed a string like "20010116" to > a function and have it return "Tuesday" - it doesn't have to be exactly this > date format that is used for the input, but I do need the name of the day on > the output! covert your date string to a unix timestamp and then use date("l", $myString) have a great day, andy :: Andrew Rush :: Lead Systems Developer :: MaineToday.com :: ************************************************************************** "Crippled but free, blind all the time, i was learning to see" - J. Garcia / R. Hunter ************************************************************************** The views expressed herein are not necessarily those of my employer, but they let me have them anyway.

« previous php.general (#34840) next »