The source code is as follows: Import java. util .*;
Public class showdate {
Public static void main (string [] ARGs ){
Calendar calendar = new gregoriancalendar ();
Date trialtime = new date ();
Calendar. settime (trialtime );
// Print out a bunch of interesting things
System. Out. println ("era:" + calendar. Get (calendar. era ));
System. Out. println ("year:" + calendar. Get (calendar. Year ));
System. Out. println ("month:" + calendar. Get (calendar. month ));
System. Out. println ("week_of_year:" + calendar. Get (calendar. week_of_year ));
System. Out. println ("week_of_month:" + calendar. Get (calendar. week_of_month ));
System. Out. println ("Date:" + calendar. Get (calendar. Date ));
System. Out. println ("day_of_month:" + calendar. Get (calendar. day_of_month ));
System. Out. println ("day_of_year:" + calendar. Get (calendar. day_of_year ));
System. Out. println ("day_of_week:" + calendar. Get (calendar. day_of_week ));
System. Out. println ("day_of_week_in_month:" + calendar. Get (calendar. day_of_week_in_month ));
System. Out. println ("am_pm:" + calendar. Get (calendar. am_pm ));
System. Out. println ("hour:" + calendar. Get (calendar. Hour ));
System. Out. println ("hour_of_day:" + calendar. Get (calendar. hour_of_day ));
System. Out. println ("minute:" + calendar. Get (calendar. Minute ));
System. Out. println ("Second:" + calendar. Get (calendar. Second ));
System. Out. println ("millisecond:" + calendar. Get (calendar. millisecond ));
System. Out. println ("zone_offset:" + (calendar. Get (calendar. zone_offset)/(60*60*1000 )));
System. Out. println ("dst_offset:" + (calendar. Get (calendar. dst_offset)/(60*60*1000 )));
System. Out. println ("current time, with hour reset to 3 ");
Calendar. Clear (calendar. hour_of_day); // so doesn't override
Calendar. Set (calendar. Hour, 3 );
System. Out. println ("era:" + calendar. Get (calendar. era ));
System. Out. println ("year:" + calendar. Get (calendar. Year ));
System. Out. println ("month:" + calendar. Get (calendar. month ));
System. Out. println ("week_of_year:" + calendar. Get (calendar. week_of_year ));
System. Out. println ("week_of_month:" + calendar. Get (calendar. week_of_month ));
System. Out. println ("Date:" + calendar. Get (calendar. Date ));
System. Out. println ("day_of_month:" + calendar. Get (calendar. day_of_month ));
System. Out. println ("day_of_year:" + calendar. Get (calendar. day_of_year ));
System. Out. println ("day_of_week:" + calendar. Get (calendar. day_of_week ));
System. Out. println ("day_of_week_in_month:" + calendar. Get (calendar. day_of_week_in_month ));
System. Out. println ("am_pm:" + calendar. Get (calendar. am_pm ));
System. Out. println ("hour:" + calendar. Get (calendar. Hour ));
System. Out. println ("hour_of_day:" + calendar. Get (calendar. hour_of_day ));
System. Out. println ("minute:" + calendar. Get (calendar. Minute ));
System. Out. println ("Second:" + calendar. Get (calendar. Second ));
System. Out. println ("millisecond:" + calendar. Get (calendar. millisecond ));
System. Out. println ("zone_offset:" + (calendar. Get (calendar. zone_offset)/(60*60*1000); // In hours
System. Out. println ("dst_offset:" + (calendar. Get (calendar. dst_offset)/(60*60*1000); // In hours
}
}