Reputation: 1
My code
Calendar calendar = Calendar.getInstance();
thisHour = calendar.get(Calendar.HOUR_OF_DAY);
Log.e(TAG + "--thisHour: ",String.valueOf(thisHour));
So this should print the hour of day as 24 hour format. When tried, then Time was 2.10pm so it should print 14. But it always print in log 3. I tried at other times too but same result. Always print time 1 hour advance and in 12 hour format. What have I done wrong ! Need guidline
Upvotes: 0
Views: 530
Reputation: 2070
This sounds like an issue related to timezone or daylight savings, etc.
Have you tried getTime() and getTimeZone() to verify that the information being returned is what you expect? or even toString() which should print everything in a readable format for you.
Upvotes: 1