Using the Calendar API I want to store the date of object creation in its instance field. The object is then saved to a text file.
Calendar cal = Calendar.getInstance();
Date todaysDate = cal.getTime();
Object obj = new Object(todaysDate);
Later, I want to return the month the object was created. However, the date was stored as type 'Date'and AFAIK the Date API doesn't have a method to return the month.
Is there a way to store the date in a variable that allows me to use Calendar methods?