CalendarTest.java



import java.util.Calendar;

public class CalendarTest {

    public static void main( String[] args ) {

        Calendar cal = Calendar.getInstance();
        int month = cal.get( Calendar.MONTH );
        int day = cal.get( Calendar.DAY_OF_MONTH );
        int hour = cal.get( Calendar.HOUR_OF_DAY );
        int minute = cal.get( Calendar.MINUTE );
        int second = cal.get( Calendar.SECOND );

        System.out.println( "MONTH=" + month );
        System.out.println( "DAY=" + day );
        System.out.println( "HOURE=" + hour );
        System.out.println( "MINUTE=" + minute );
        System.out.println( "SECOND=" + second );
    }
}