| Author |
Formatting date from MySql
|
|
|
|
|
|
| Ninjaboy 2004-10-20, 8:55 pm |
| Just use
SELECT UNIX_TIMESTAMP(date) from your_sql_table;
then do the $formated = date("l dS of F Y h:i:s A",$sql[date]);
"Harrie Verveer" <newsgroup{remove-this}@harrieverveer.com> wrote in message
news:7fednT-Y-8O64OvcRVnyvg@zeelandnet.nl...[color=darkred]
> yes
> http://nl3.php.net/manual/en/function.date.php
>
> oeyvind toft wrote:
| |
| oeyvind toft 2004-10-20, 8:55 pm |
| Perfect !
Thanks Ninjaboy, just what I was looking for...
Oeyvind
--
http://home.online.no/~oeyvtoft/ToftWeb/
"Ninjaboy" <ninjaboy@yourunderground.com> skrev i melding
news:JCzdd.8187$6q2.823@newssvr14.news.prodigy.com...
> Just use
> SELECT UNIX_TIMESTAMP(date) from your_sql_table;
>
> then do the $formated = date("l dS of F Y h:i:s A",$sql[date]);
>
>
> "Harrie Verveer" <newsgroup{remove-this}@harrieverveer.com> wrote in
message
> news:7fednT-Y-8O64OvcRVnyvg@zeelandnet.nl...
>
>
| |
| Chris Hope 2004-10-20, 8:55 pm |
| Ninjaboy wrote:
[color=darkred]
[color=darkred]
> Just use
> SELECT UNIX_TIMESTAMP(date) from your_sql_table;
>
> then do the $formated = date("l dS of F Y h:i:s A",$sql[date]);
The other way to do it, and to avoid using proprietary database functions
that are not portable to other database systems, is to do the following:
date('format here', strtotime($date_in_dbformat));
where $date_in_dbformat is the date and time returned from the database.
For more info refer to the manual:
http://www.php.net/date
http://www.php.net/strtotime
--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
| |
| oeyvind toft 2004-10-20, 8:55 pm |
|
"Chris Hope" <blackhole@electrictoolbox.com> skrev i melding
news:1098311223_28048@216.128.74.129...
> The other way to do it, and to avoid using proprietary database functions
> that are not portable to other database systems, is to do the following:
>
> date('format here', strtotime($date_in_dbformat));
>
> where $date_in_dbformat is the date and time returned from the database.
Even better...
Thanks Chris
Oeyvind
http://home.online.no/~oeyvtoft/ToftWeb/
|
|
|
|