Page 1 of 1

Convert date dd/mm/yyyy to ddd ?

Posted: Thu Feb 19, 2004 12:05 pm
by Nasimov
I have the date taken form a mySQL db set in format: DD/MM/YYYY - (i.e. 17/02/2004), how can I display the day for that particular date (i.e Tuesday).

Thanks.

Posted: Thu Feb 19, 2004 12:09 pm
by John Cartwright
It's possible no doubt, but it won't be easy :S

Posted: Thu Feb 19, 2004 12:33 pm
by johnperkins21

Posted: Thu Feb 19, 2004 2:06 pm
by Dr Evil
You can try this:

Code: Select all

<?php
$date = "17/02/2004";
$parts= explode("/",$date);
echo date("l",mktime(0, 0, 0, $parts[1], $parts[0], $parts[2]));
?>
But why do you not get the date from your SELECT query ?