I\'m converting a UTC time to another timezone, using this method:
SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");
Date parsed = for
You can Parse your date format and time zone according to your requirements. Try this snippet of code i hope it helpful for you.
private String getFormattedDate(String OurDate) {
try {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); // According to your Server TimeStamp
formatter.setTimeZone(TimeZone.getTimeZone("UTC")); //your Server Time Zone
Date value = formatter.parse(OurDate); // Parse your date
SimpleDateFormat dateFormatter = new SimpleDateFormat("MM-dd-yyyy"); //this format changeable according to your choice
dateFormatter.setTimeZone(TimeZone.getDefault());
OurDate = dateFormatter.format(value);
} catch (Exception e) {
OurDate = "00-00-0000 00:00";
}
return OurDate;
}