Code example for GregorianCalendar

Methods: get, setTime

0
		if (d == null) {
 
			throw new NullPointerException("Incorrect date string");
		} 
 
		Calendar c = new GregorianCalendar(); 
		c.setTime(d);
		year = c.get(Calendar.YEAR);
		month = c.get(Calendar.MONTH);
		dayOfMonth = c.get(Calendar.DAY_OF_MONTH);
	} 
 
	/** Returns the deadline's year. */ 
	public int getYear() { 
 
		return year;
	} 
 
	/** Returns the deadline's month (January is 0). */ 
	public int getMonth() {