Calendar.AM has the following syntax.
public static final int AM
In the following code shows how to use Calendar.AM field.
/* w w w .j av a2 s . c om*/ import java.util.Calendar; import java.util.GregorianCalendar; public class Main { public static void main(String[] args) { Calendar cal = new GregorianCalendar(); System.out.println(cal.getTime()); cal.set( Calendar.AM_PM, Calendar.AM ); System.out.println(cal.getTime()); } }
The code above generates the following result.