Re: date

From: Osvaldo Rosário Kussama <osvaldo_kussama(at)yahoo(dot)com(dot)br>
To: pgsql-sql(at)postgresql(dot)org, superboy143(at)gmail(dot)com
Subject: Re: date
Date: 2006-02-10 16:07:52
Message-ID: 43ECBA58.3060303@yahoo.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

superboy143 (sent by Nabble.com) wrote:

>Hello,
>
>How can I write an sql query in postgresql so that I can insert a date into
>a table in the format DD-MM-YYYY, and when I select the date from the table
>I should get the date in the same format.
>
>

See postgresql.conf documentation
(http://www.postgresql.org/docs/8.1/interactive/runtime-config-client.html#RUNTIME-CONFIG-CLIENT-FORMAT):
17. Server Configuration
17.10.2. Locale and Formatting

DateStyle = 'German, dmy'
- output format specification: German
- input/output specification for year/month/day ordering: DMY

postgres=# SHOW datestyle;
DateStyle
-------------
German, DMY
(1 row)

postgres=# SELECT CURRENT_DATE;
date
------------
10.02.2006
(1 row)

postgres=# SELECT to_char('09/03/2005'::date,'dd/mon/yyyy');
to_char
-------------
09/mar/2005
(1 row)

[]s
Osvaldo


_______________________________________________________
Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora!
http://br.acesso.yahoo.com

In response to

  • date at 2006-02-10 06:18:09 from superboy143 (sent by Nabble.com)

Browse pgsql-sql by date

  From Date Subject
Next Message Ken Hill 2006-02-10 16:17:00 Re: date
Previous Message A. Kretschmer 2006-02-10 06:38:23 Re: date