Re: Date formatting

From: Date: Fri, 06 Apr 2001 13:39:34 +0000
Subject: Re: Date formatting
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47438@lists.php.net to get a copy of this message
Something I almost always do when pulling dates from a mySQL table is format the date column in the query itself using the mySQL function DATE_FORMAT()... At 01:13 PM 4/6/01 +0100, Matt Davis wrote:
Hi I am trying to format a date extracted from my DB. I have run my query and then have used the following to get my row data
      while ($row = mysql_fetch_array($sql_result)) {
                 $title = $row["message_title"];
                 $message = $row["message"];
                 $event = $row["date_of_event"];
                 $shortevent = date ("D j M", $event);
I am trying to take $event and make it diplay like this "FRI 06 APR" using the date function. Although $event outputs like this "2001-04-06 00:00:00" $shortevent outputs "Thu 1 Jan" which is unix epoch date. Does anybody know what I am doiing wrong its probably something really simple but I cant see what. Matt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.general (#47438) next »