Date codes not agreeing. MySQL and PHP.
Posted: Sat Apr 05, 2003 4:36 pm
I have dates stored in a MySQL database in 0000-00-00 format.
I am running this script...
My problem is in the print line, it outputs "12.31.1969" for April 5, 2003.
I am guessing that PHP is equating "2003-04-05" to "1994" and then using that as unix timecode.
Given that "$bigdate" is "2003-04-05" how can I print "04.05.2003"?
For another application I am going to need to print "april . 05 . two thousand three" so any help there would also be appreciated.
I am running this script...
Code: Select all
$sql = "select thought_date from thoughts order by thought_date";
$result = @mysql_query($sql) or die("could not complete your query");
$bigdate = 0;
while($row = mysql_fetch_array($result)) {
$date = $rowї"thought_date"];
if($date > $bigdate){$bigdate = $date;}
}
print (date("m.d.Y", $bigdate));I am guessing that PHP is equating "2003-04-05" to "1994" and then using that as unix timecode.
Given that "$bigdate" is "2003-04-05" how can I print "04.05.2003"?
For another application I am going to need to print "april . 05 . two thousand three" so any help there would also be appreciated.