The saved time in the application is in UTC. The users of the application are in different timezones, such as PST, IST etc.
My issue is very similar to the one in this post. I tried implementing a solution provided there, but it does not seem to be working for me:
Calendar calendar = Calendar.getInstance();
calendar.setTime(history.getCreatedTimestamp());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
//Here you say to java the initial timezone. This is the secret
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
//Will print in UTC
System.out.println(sdf.format(calendar.getTime()));
//Here you set to your timezone
sdf.setTimeZone(TimeZone.getDefault());
//Will print on your default Timezone
System.out.println(sdf.format(calendar.getTime()));