Skip site navigation (1) Skip section navigation (2)

Problem with to_date function

From: Gilberto C Andrade <gilbertoca(at)secad(dot)to(dot)gov(dot)br>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Problem with to_date function
Date: 2005-08-22 19:31:51
Message-ID: 430A2827.9060907@secad.to.gov.br (view raw or flat)
Thread:
Lists: pgsql-jdbc
Hi,

I would like to know if the following is the expected result:
from psql:
bcoproducao=# select to_date(current_date, 'DD/MM/YYYY'), current_date;
  to_date   |    date
------------+------------
 22/08/2005 | 22/08/2005
(1 row)

from my jdbc code:
            rs = stmt.executeQuery("select to_date(current_date, 
'DD/MM/YYYY'), current_date");           
            while (rs.next()) {
                System.out.println(rs.getString(1) + " | " 
+rs.getString(2));
            }
result:
            0028-01-26 | 2005-08-22

Any advice here?
Thanks!
Gilberto



Responses

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2005-08-22 20:15:45
Subject: Re: Problem with to_date function
Previous:From: PrasanthDate: 2005-08-22 15:02:13
Subject: Re: Bad value for type date

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group