Editing the whole question .
In my oracle database table, the value of date is 23-07-23 12:00:00.000000000 AM
. The datatype is TimeStamp(6)
When I am trying to read this value using below code, I am getting 2020-07-23 00:00:00.0
.
How do I read the exact value? Finally I need to convert this to epoch time.
I am using below code for doing all this which is not giving me the correct answer.
Timestamp date = rs.getTimestamp(3);
SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
String formattedDate = dateFormat.format(date);
obj.setFlightDate(dateFormat.parse(formattedDate).getTime());
I am getting epoch time as 1595442600000, whereas I should be getting 1595462400000