Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Server-side Scripting _ mysgl

Posted by: cookie mutza Oct 13 2006, 03:06 PM

can anyone tell me anything about mysqls date functions

Posted by: cookie mutza Oct 13 2006, 03:08 PM

and how i can call them through php

Posted by: Sparkyg Oct 14 2006, 06:21 AM

Hi There

To display dates from mysql, a couple of funtions I use, just pass in the date in your SQL result, the format can be changed to display any format you like

function ConvFromMySQL2($sqldate) {
$format= "d F Y";
$mydate = date($format,strtotime($sqldate));
return $mydate;
}

function ConvFromMySQL3($sqldate) {
$format= "Y-m-d";
$mydate = date($format,strtotime($sqldate));
return $mydate;
}


to use mysql date functions in mysql just stick them in your query


cheers

Sparky

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)