How Can I convert this java.util.Date format:
2015-01-16 00:00:00.0
to this java.util.Date format:
2015-01-16 00:00:00 GMT+00:00
How Can I convert this java.util.Date format:
2015-01-16 00:00:00.0
to this java.util.Date format:
2015-01-16 00:00:00 GMT+00:00
You're going to need to use java.text.SimpleDateFormat
.
Something as follows:
final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
System.out.println(sdf.format(new Date()));
would print something like this: 2001-07-04 12:08:56 PDT
.
I hope that helps.
Have you tried using the SimpleDateFormat?
http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html