Re: Date question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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@xxxxxxxxxxxxxxxxx | Telephone: (503) 222.2783



[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux