//----------------------------------------------------------------------------------
// use a calendar to compute year, month, day, hour, minute, and second values.
GregorianCalendarcalendar = newGregorianCalendar();
System.out.println("Today is day " + calendar.get(Calendar.DAY_OF_YEAR) + " of the current year.");//----------------------------------------------------------------------------------