You're not saying it explicitly, but I suspect that your code looks like this:

Note that that's not the correct way to use Calendar.HOUR_OF_DAY. In fact, HOUR_OF_DAY is a constant in class Calendar that you should pass to the get() method, for example:

So, HOUR_OF_DAY is not the actual hour, it's just a "label" that you can use with the get() method (and other methods).

Calendar c = Calendar.getInstance(TimeZone.getTimeZone("EST"));

c.get(Calendar.HOUR_OF_DAY) returns 1 for the above scenario where the actual hour (as per the current timezone which is EST) is 16 and it returned 0 when the time was 15hours.

My question is what math will help me to get 16 from 1 or 15 from 0?

Note that in the long string I also see HOUR_OF_DAY=6, so that's consistent with what I get from cal.get(Calendar.HOUR_OF_DAY). (Note, the local time here is 13:52, so 6:52 in EST should be right).

If I look at your output, in the long line I also see HOUR_OF_DAY=1 so it looks right that get(Calendar.HOUR_OF_DAY) returns 1 for your case.

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com