Re: Date question

Поиск
Список
Период
Сортировка
От Robby Russell
Тема Re: Date question
Дата
Msg-id 3F5F3610.60408@commandprompt.com
обсуждение исходный текст
Ответ на Date question  ("Grant Henderson" <granth@fusion-advertising.co.uk>)
Список pgsql-php
Grant Henderson wrote:
> How do I convert a postrgesql timestamp
> To an english date
>
> E.g.
>     $order_date = "2003-09-10 09:40:30+01";
>     $date = date("d/M/Y", $order_date);
>     print($date);
>

Why not just do it in the database before you get to the PHP?


=# SELECT to_char(now(), 'Month-fmdd-yyyy'::text);

       to_char
-------------------
  September-10-2003
(1 row)


More info:

http://www.postgresql.org/docs/7/interactive/functions2976.htm

Hope that can help,

-Robby





--
Robby Russell,  |  Sr. Administrator / Lead Programmer
Command Prompt, Inc.   |  http://www.commandprompt.com
rrussell@commandprompt.com | Telephone: (503) 222.2783


В списке pgsql-php по дате отправления:

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: Date question
Следующее
От: "Tran Anh Tu"
Дата:
Сообщение: Help me