Re: mysql date to php date
| From: | Justin Garrett | Date: | Thu, 08 Aug 2002 16:54:28 +0000 |
| Subject: | Re: mysql date to php date | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-111677@lists.php.net to get a copy of this message | ||
You could use the MySQL UNIX_TIMESTAMP() function and then the php date(),
or just use the MySQL DATE_FORMAT() function.
http://www.mysql.com/doc/en/Date_and_time_functions.html
http://www.php.net/manual/en/function.date.php
Justin
"Mantas Kriauciunas" <Mantuks@attbi.com> wrote in message
news:1768107861.20020808000748@attbi.com...
> Hey php-general,
>
> i have date field in my database
> it has value:
> $date = "20020804125536"
>
> how do i take it from database to page and convert to normal date?
> can somebody point me to some tutorials or what function to use...i
> have hard time lookin for that...thanks
>
> i have like this:
>
> while ($row = mysql_fetch_array($resultatai)) {
> $gb_date = $row['date'];
> ....
> echo "$gb_date";
>
> in page looks like: 20020804125536
>
> --
> Best regards,
> Mantas
>
> Contacts:
> Mantuks@attbi.com
> Http://www.mntkz.net
>