3:06 pm - Tuesday September 26, 3048

Calendar in java example program clear()

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

/**
*@author:candidjava
&@description:Calendar in java example program for clear()
**/
import java.util.Calendar;
public class CalendarClear
{
public static void main(String[] args)
{
// create calendar object
Calendar cal = Calendar.getInstance(); // displays the current date and time
System.out.println("Current Calendar Date: " + cal.getTime()); // use clear method to set all field values and time value as undefined.
cal.clear(); // print the result
System.out.println("The calendar shows : " + cal.getTime());
}
}

Output:
Current Calendar Date: Thu Oct 11 14:50:48 IST 2012
The calendar shows : Thu Jan 01 00:00:00 IST 1970

BACK

Filed in: Z-A All Java Codes

Comments are closed.