Re: Date question - Mailing list pgsql-php

From scott.marlowe
Subject Re: Date question
Date
Msg-id Pine.LNX.4.33.0309100750041.16181-100000@css120.ihs.com
Whole thread Raw
In response to Date question  ("Grant Henderson" <granth@fusion-advertising.co.uk>)
List 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 by date:

Previous
From: Frank Bax
Date:
Subject: Re: Date question
Next
From: Robby Russell
Date:
Subject: Re: Date question