| From: | Frank Bax <fbax(at)sympatico(dot)ca> |
|---|---|
| To: | pgsqlnovice <pgsql-novice(at)postgresql(dot)org> |
| Subject: | Re: Date Format Question |
| Date: | 2005-12-05 19:11:46 |
| Message-ID: | 5.2.1.1.0.20051205140503.03161630@pop6.sympatico.ca |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
At 01:33 PM 12/5/05, Ângelo Marcos Rigo wrote:
>I do receive a date from a text box with this format:
>dd/mm/yyyy
>
>And i am inserting into Postgresql Database usign
>(eg.):
>INSERT INTO Mycalendar (Date) VALUES
>(to_date('31/12/2005','mm/dd/yyyy')).
>
>But for the "day" values above 10 (wich have not a
>zero on his front) the month gets in the day place in
>the database so :
>31/12/2005 wich was suposed to be stored in this
>format 2005-31-12
That's weird, because on my system to_date('31/12/2005','mm/dd/yyyy')
produces 2007-07-14! Perhaps you meant to_date('31/12/2005','dd/mm/yyyy')?
>Is being stored in this format : 2005-12-31
No it's not - that's just how you "see" it with a default select of date
column.
>How can i store the date in the right format:(2005-31-12) ?
You cannot - but to_char(date,'dd/mm/yyyy') might be what you are really
looking for.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2005-12-05 19:42:27 | Re: Date Format Question |
| Previous Message | Ângelo Marcos Rigo | 2005-12-05 18:33:13 | Date Format Question |