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.