I want to convert "yyyy'-'MM'-'dd HH':'mm':'ss'Z'
" date format to "yyyy'-'MM'-'dd HH':'mm':'ss
" in java.
i.e. i have a date like "22-11-2017 23:42:09:0
" and i want to convert it into "22-Nov-2017 23:42:09
".
I want to convert "yyyy'-'MM'-'dd HH':'mm':'ss'Z'
" date format to "yyyy'-'MM'-'dd HH':'mm':'ss
" in java.
i.e. i have a date like "22-11-2017 23:42:09:0
" and i want to convert it into "22-Nov-2017 23:42:09
".
If so urgent,
String newValue = oldValue.substring(0, oldValue.lastIndexOf(":"));
would be enough.
Why don't you use to_date() function in oracle sql. You can also get the output of the query by doing :
select to_date(#your format#)
from dual