Re: date
От | Osvaldo Rosário Kussama |
---|---|
Тема | Re: date |
Дата | |
Msg-id | 43ECBA58.3060303@yahoo.com.br обсуждение исходный текст |
Ответ на | date ("superboy143 (sent by Nabble.com)" <lists@nabble.com>) |
Список | 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
В списке pgsql-sql по дате отправления: