I have oracle database with columns data type "TIMESTAMP(0) WITH TIME ZONE
" . Which produces
like 14/11/2019 06:30:00, +03:00 in database .
When I am trying to get this timestamp from java
I got java.text.ParseException: Unparseable date: "28-MAY-12 07.40.03 PM +03:00"
. Our project java version is 6 . I tried with
new SimpleDateFormat("dd-MM-yy hh.mm.ss") ,
new SimpleDateFormat("dd-MM-yy hh.mm.ss, Z"),
new SimpleDateFormat("dd-MM-yy hh.mm.ss, z") ,
new SimpleDateFormat("dd/MM/yy hh.mm.ss, z") ,
new SimpleDateFormat("dd/MM/yy hh.mm.ss, Z") ,
new SimpleDateFormat("dd/MM/yy hh.mm.ss")
But none of them worked for me all of throwing java.text.ParseException: Unparseable date error.
In my java side i have date datatype property in my class and i want to retrieve data from oracle database then parse then set to date data type property like below.
serDto.setTarih(new Timestamp(new SimpleDateFormat("dd-MM-yy hh.mm.ss").parse(str).getTime()));
For ex in db timestamp data looks like : 14/11/2019 06:30:00, +03:00 and i want to retrieve as date like above.
Thank you in advance.