java calendar to date

Date to Calendar Java

Sometimes in Java, it is necessary to convert in between Date to Calendar and Calendar to Date classes. Note: It is assumed that you know about the basic concepts of class Date and class GregorianCalendar. It is done in the following code.

Output screen on Date to Calendar conversion Example…

class GregorianCalendar

GregorianCalendar is a concrete class, a subclass of abstract class Calendar. The GregorianCalendar class represents the calendar we use everyday. It is used to manipulate date and retrieve date particulars. This was introduced with JDK 1.1. Following statement gives the class signature public class GregorianCalendar extends Calendar Following program illustrates…