-- Code :
SimpleDateFormat dateFormat2 = new SimpleDateFormat("hh:mm a MM/dd");
SimpleDateFormat hh_mm_ss = new SimpleDateFormat("yyyy-MM-dd HH:mm");
hh_mm_ss.setTimeZone(TimeZone.getTimeZone("UTC"));
try {
dat1 = hh_mm_ss.parse(arraylist.get(position).get("createdate"));
Log.e("time", dat1.toString());
String out = dateFormat2.format(dat1);
tvTime.setText(out);
} catch (ParseException e) {
e.printStackTrace();
}
-- Log :
E/time: Mon Apr 25 07:59:00 GMT+05:30 2016
-- But when is print in Text-view it gives me server time only, not local time