I looked at the java api about GregorianCalendar and did not see any way to set am / pm in its constructor. Can you set AM / PM to a GregorianCalendar date or is it something you can only use with the get method on the calendar. Does this all do this automatically. I want to take am / pm and output it to my toString for a class that has a date object. I was going to use the get method on the calendar to get this. I understand that am / pm is an int that is 0 or 1.
I was also wondering if all the hours in gregorian are 24 hours and it automatically detects am and pm?
Calendar.get(Calendar.HOUR);
(0-12) AM/PM.
Calendar.get(Calendar.HOUR_OF_DAY);
0 24.
. .
cal.set( Calendar.AM_PM, Calendar.AM )
/ , . ( 1:00 1:00 AM). GregorianCalendar (. ).
GregorianCalendar
Btw/Hint imo DateFormat, .
DateFormat
Calendar cal = new GreogorianCalendar(); cal.set( Calendar.AM_PM, Calendar.AM );