Page 1 of 1

them damn pesky dates that i hates

Posted: Wed Jun 04, 2003 2:44 am
by Deddog
Trying to display the day of the week for every date record i pull from a table. Have tried all sort's but have ended up with the below examples. The first one is the one i would have my money on, but they both keep giving me thursday!! Any idea's

Code: Select all

<?PHP
//1.
$TheDay      = gmdate("l",$row["BookedDate"] );

//2.
$Break       = '-';  
$DateArray1  = array_reverse(explode('/',$row["BookedDate"]));  
$ReturnDate1 = implode($Break, $DateArray1); 
$TheDay      = gmdate("l",$ReturnDate1);

//3.
$DateArray1  = array(explode('/',$row["BookedDate"]));  
$ReturnDate1 = implode("",$DateArray1); 
$TheDay      = gmdate("l",$ReturnDate1);
mod_edit: added

Code: Select all

tags (and comment signs)[/size]

Posted: Wed Jun 04, 2003 3:09 am
by []InTeR[]
Why don't let the database calculate it for you....

Here are the date and time functions

Oi oi

Posted: Wed Jun 04, 2003 4:40 am
by Deddog
DAYNAME(b.BookedDate) as TheDay

Many thanks InTer

Posted: Wed Jun 04, 2003 4:59 am
by []InTeR[]
No thnx