No time displayed, Oracle Date field using getDate
843859May 4 2007 — edited Nov 20 2014I am trying to get a date + time from a DATE field in an ORACLE database.
I have the following code in java:
Date dt = rs.getDate(�APPROVED_DATE�);
System.out.println(new SimpleDateFormat("yyyy.MM.dd G 'at' HH:mm:ss z").format(new java.util.Date(dt.getTime())));
The result I get is:
2007.05.04 AD at 00:00:00 EDT
If I am looking at the field value in the Database with the following function:
select to_char(APPROVED_DATE, 'Dy DD-Mon-YYYY HH24:MI:SS') from SCENARIO_COT_STATUS
this is the result I get:
Fri 04-May-2007 14:26:15
for some reason I am loosing the Time in the Java result.
Any clue what is the solution?
Thanks,
Jon