I know that there are dozens of UTC Time / Date To / From local time conversion response messages, but they did not help me figure out my problem. My question is: Having a UTC timestamp, how can I get a local DateTime? This is what I have now, but it just converts the timestamp to DateTime format.
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); sdf.setTimeZone(TimeZone.getDefault()); sdf.format(new Date(timestamp * 1000));
Edited: I save the UTC timestamp in the cloud so that each device (Android / iOS) can request and convert the timezone to it.
source share