Search Postgresql Archives

Re: How to convert US date format to European date format ?

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

 



On 04/10/2013 06:03 AM, Condor wrote:
Hello ppl,

I have a database where the previous owner use US date format in date
fields:

2009-02-18

Is there a way how to convert the fields in European format 18-02-2009.
I mean existing date in records. What's will be happened if I change format
in postgresql.conf ?

The dates are stored as a non formatted value. What you are seeing is the output formatting:

http://www.postgresql.org/docs/9.2/interactive/datatype-datetime.html#DATATYPE-DATETIME-OUTPUT

In other words the data in the fields will not be converted.

If you want a European style formatting then you can set the DateStyle='SQL,DMY':

test=> set datestyle='SQL,DMY';
SET
test=> SELECT now()::date;
    now
------------
 10/04/2013
(1 row)


This can be done as needed or by setting it in postgresql.conf



Cheers,
Hristo S.




--
Adrian Klaver
adrian.klaver@xxxxxxxxx


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux