How to change timestamp format to other format?
The default is "yyyy-MM-dd hh:mm:ss
" and I need 'dd-MON-yyy hh24:mi:ss
' (like in Oracle).
I searched on this site and I found some answers, but I could not match them to my needs.
How to change timestamp format to other format?
The default is "yyyy-MM-dd hh:mm:ss
" and I need 'dd-MON-yyy hh24:mi:ss
' (like in Oracle).
I searched on this site and I found some answers, but I could not match them to my needs.
I am not sure if this is, what you are looking for: http://www.java2s.com/Tutorial/Java/0040__Data-Type/SimpleDateFormat.htm
Use Simple Date Format like below
Date date=new SimpleDateFormat("dd-MMM-yyy HH:mm:ss").parse(stringToBeParsed);
Hope this helps.
i think you want GMT String format 21 Jul 2014 12:22:34 GMT,
here i used as below, passed time in long...
new Timestamp(System.currentTimeMillis()).toGMTString()