I want to convert timezone from GMT to local timezone based on the device,s location. I have tried various method but not getting the desired result. I know there are lot of solution over the net but i am stuck here.So how can i dot that?I have a GMT timezone format like : 2019-04-10T08:20:25Z
This is the code i have tried so far:
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy:MM:dd'T'HH:mm:ss'Z'");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
try {
Date myDate = simpleDateFormat.parse(onlyDate);
android.util.Log.v("Df", String.valueOf(myDate));
} catch (ParseException e) {
e.printStackTrace();
}
Here onlyDate is the GMT timezone