note 6784 deleted from date by ronabop

From: Date: Sat, 10 Mar 2001 23:02:46 +0000
Subject: note 6784 deleted from date by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-12219@lists.php.net to get a copy of this message
I have been having some problems taking a date entry from a MySQL database (YYYY-MM-DD) and using the date() command to format. I wasnt able to just insert the query output into the date() command because it kept defaulting to 1st jan 1970. The only way I was able to do it was with the following. $date=$query_disp[date]; $year=substr($date,0,4); $month=substr($date,5,2); $day=substr($date,8,2); $fdate = date("jS F Y",mktime (0,0,0,$month,$day,$year));

« previous php.notes (#12219) next »