I'm very new to Java.
I'm fetching this date 1995-01-28T17:02:12.936000-0500
from oracle db and now I want to convert it into yyyy-MM-dd HH:mm:ss
format. I have tried below method
SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSS");
Date c=sdf.parse("1995-01-28T17:02:12.936000-0500");
SimpleDateFormat sdf1=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(sdf1.format(c));
I'm getting below output
1995-2-28 17:17:48
You can see that 17:02:12 is getting changed to 17:17:48. How do I fix this ?