RupertA
asked on
date conversion to full date
I have retrieved a date from my mysql database into a javascript variable and I am showing this javascript variable on a certificate. I am in UK so I want to present it day month year. So the date I return at the bottom for say 24th march 2009 is
24-03-2009.
However I want to display it as 24 March 2009.
Could anybody help me with that. This is purely for display purposes. Obviously I want this format for any date I return. Below is the mysql statement I ran from my php file to return the date.
Thanks.
24-03-2009.
However I want to display it as 24 March 2009.
Could anybody help me with that. This is purely for display purposes. Obviously I want this format for any date I return. Below is the mysql statement I ran from my php file to return the date.
Thanks.
$query = "SELECT passed, date_format(passdate,'%d-%m-%Y') as passdate FROM courses WHERE userref='$userref' and courseID='$courseID'";
$res2 = mysql_query($query) or fail("Failed getting passed from database");
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
not sure if I can use strtotime as my variable is not necessariy 24-03-2009. It may be any date.
thanks.
thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.php.net/date