Currently the date in my app is stored as an ISO date 2016-08-26T11:03:39.000+01:00
.
If the user went to an event at 11:03:39 in the UK, it wouldn't make sense for this time to show 06:03:39 in Florida, USA for example. This is currently happening in my app.
How do I convert the ISO date back to the time the event happened locally no matter where the event happened and where the user is?
Below is the code which I'm currently using.
DateFormat isoDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
DateFormat dateFormat = new SimpleDateFormat("dd MMM yyyy");
DateFormat timeFormat = new SimpleDateFormat("hh:mm a");
mDate = isoDateFormat.parse(isoDateString);
dateString = dateFormat.format(mDate);
timeString = timeFormat.format(mDate);