Re: Date format - Mailing list pgsql-novice

From Michael Glaesemann
Subject Re: Date format
Date
Msg-id F50925C7-4286-4ABF-96BC-FB2D3F9153BF@seespotcode.net
Whole thread Raw
In response to Date format  (Dylan Fogarty-MacDonald <dylan.fm@gmail.com>)
Responses Re: Date format
List pgsql-novice
On Jul 31, 2006, at 14:23 , Dylan Fogarty-MacDonald wrote:

> I am using PG 7.3.4.

I strongly recommend upgrading, if not to the latest 8.1.4, then to
the most recent release of 7.3.15. These include patches to security
flaws and data-loss-incurring bugs. 8.1.4 will most likely perform
much better for you as well.

> if to_date() converts a string to date, what converts/formats date
> to string?

I think you'll want to look at TO_CHAR:

http://www.postgresql.org/docs/current/interactive/functions-
formatting.html

I've found it useful to use EXTRACT(EPOCH FROM your_timestamp) to
pass the timestamp to PHP, and then use the PHP timestamp formating
functions.

http://www.postgresql.org/docs/current/interactive/functions-
datetime.html#FUNCTIONS-DATETIME-EXTRACT

Hope this helps.

Michael Glaesemann
grzm seespotcode net




pgsql-novice by date:

Previous
From: Dylan Fogarty-MacDonald
Date:
Subject: Date format
Next
From: Michael Glaesemann
Date:
Subject: Re: Date format