From: | Frank Bax <fbax(at)sympatico(dot)ca> |
---|---|
To: | pgsql-php(at)postgresql(dot)org |
Cc: | "Grant Henderson" <granth(at)fusion-advertising(dot)co(dot)uk> |
Subject: | Re: Date question |
Date: | 2003-09-10 13:54:46 |
Message-ID: | 5.2.1.1.0.20030910095139.00a11c60@pop6.sympatico.ca |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-php |
At 05:46 AM 9/10/03, 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);
The input to php "date" function is a unix timestamp, not a string.
Use:
select date_part('epoch',order_date) from ...
instead of
select order_date from ...
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
From | Date | Subject | |
---|---|---|---|
Next Message | scott.marlowe | 2003-09-10 13:55:32 | Re: Date question |
Previous Message | Bastiaan Wakkie | 2003-09-10 13:51:34 | Re: Help me |