Answer the question
In order to leave comments, you need to log in
How to find out the time in a format, not 12, but 24 hours?
This command gives the clock in 12 hour format. hour=c.get(c.HOUR);
How to get the time in 24?
Answer the question
In order to leave comments, you need to log in
The staff telepath suggested that c is Calendar .
You either need to use Calendar.HOUR_OF_DAY instead of Calendar.HOUR, or use Calendar.HOUR and Calendar.AM_PM in order to understand before or after 12 o'clock.
Accessing static fields through an instance is bad.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question