Re: mysql date to php date
| From: | Krzysztof Dziekiewicz | Date: | Thu, 08 Aug 2002 10:15:56 +0000 |
| Subject: | Re: mysql date to php date | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-111620@lists.php.net to get a copy of this message | ||
Thursday, August 8, 2002, , wrote:
MK> i have date field in my database
MK> it has value:
MK> $date = "20020804125536"
MK> how do i take it from database to page and convert to normal date?
MK> can somebody point me to some tutorials or what function to use...i
MK> have hard time lookin for that...thanks
MK> i have like this:
MK> while ($row = mysql_fetch_array($resultatai)) {
MK> $gb_date = $row['date'];
MK> ....
MK> echo "$gb_date";
MK> in page looks like: 20020804125536
Probably you have defined date field as 'YYYYMMDDHHMMSS'
You may get date in a more nice form:
select DATE_FORMAT(date,'%Y.%D.%M %h:%i')
--
Krzysztof Dziekiewicz