public Date getDate() {
		try {
			Calendar c = Calendar.getInstance(timeZone);

			if ((mode & DATE) != 0) {
				String s = dateField.getText();
				c.set(Calendar.YEAR, Integer.parseInt(s.substring(0, 4)));
				c.set(Calendar.MONTH, Integer.parseInt(s.substring(5, 7))-1 +Calendar.JANUARY);
				c.set(Calendar.DAY_OF_MONTH, Integer.parseInt(s.substring(8, 10)));
			}
			else
				c.setTime(new Date(0));

			if ((mode & TIME) != 0) {
				String s = timeField.getText();
				c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(s.substring(0, 2)));
				c.set(Calendar.MINUTE, Integer.parseInt(s.substring(3, 5)));
			}
			else {
				c.set(Calendar.HOUR_OF_DAY, 0);
				c.set(Calendar.MINUTE, 0);
			}
			c.set(Calendar.SECOND, 0);
			c.set(Calendar.MILLISECOND, 0);

			return c.getTime();
		}
		catch (Exception e) {
			return null;
		}
	}