Re: Date question

Поиск
Список
Период
Сортировка
От scott.marlowe
Тема Re: Date question
Дата
Msg-id Pine.LNX.4.33.0309100750041.16181-100000@css120.ihs.com
обсуждение исходный текст
Ответ на Date question  ("Grant Henderson" <granth@fusion-advertising.co.uk>)
Список pgsql-php
On Wed, 10 Sep 2003, 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);

You can either split out the parts and use mktime to get a timestamp, then
feed that timestamp to date(), or you can do it in postgresql with
something like SET DateStyle TO 'US' and then see how they come out.

Finally, you could use the extract() function to pull the date in the
format you want ahead of time:

select extract(YEAR from field)||'/'||extract(MONTH from
field)||'/'||extract(day from field);

And get it that way.


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

Предыдущее
От: Frank Bax
Дата:
Сообщение: Re: Date question
Следующее
От: Robby Russell
Дата:
Сообщение: Re: Date question