timeParser = new SimpleDateFormat("EEEE HH:mm:ss");
timeParser = new SimpleDateFormat("EEEE HH:mm:ss yyyyMMdd");
    SessionSchedule(SessionSettings settings, SessionID sessionID) throws ConfigError, FieldConvertError {        if (settings.isSetting(sessionID, Session.SETTING_START_DAY) && !settings.isSetting(sessionID, Session.SETTING_END_DAY))        {            throw new ConfigError("Session " + sessionID + ": StartDay used without EndDay");        }        if (settings.isSetting(sessionID, Session.SETTING_END_DAY) && !settings.isSetting(sessionID, Session.SETTING_START_DAY))        {            throw new ConfigError("Session " + sessionID + ": EndDay used without StartDay");        }        String startTimeString = settings.getString(sessionID, Session.SETTING_START_TIME);        String endTimeString = settings.getString(sessionID, Session.SETTING_END_TIME);        boolean weeklySession = false;        SimpleDateFormat timeParser = null;        if (settings.isSetting(sessionID, Session.SETTING_START_DAY) && settings.isSetting(sessionID, Session.SETTING_END_DAY))        {            startTimeString = settings.getString(sessionID, Session.SETTING_START_DAY) + " " + startTimeString;            endTimeString = settings.getString(sessionID, Session.SETTING_END_DAY) + " " + endTimeString;            weeklySession = true;            timeParser = new SimpleDateFormat("EEEE HH:mm:ss");        } else {            timeParser = new SimpleDateFormat("HH:mm:ss");        }        if (settings.isSetting(sessionID, Session.SETTING_TIMEZONE)) {            String sessionTimeZoneID = settings.getString(sessionID, Session.SETTING_TIMEZONE);            sessionTimeZone = TimeZone.getTimeZone(sessionTimeZoneID);            if ("GMT".equals(sessionTimeZone.getID()) && !"GMT".equals(sessionTimeZoneID)) {                throw new ConfigError("Unrecognized time zone '" + sessionTimeZoneID + "' for session " + sessionID);            }        } else {            sessionTimeZone = TimeZone.getTimeZone("UTC");        }        timeParser.setTimeZone(sessionTimeZone);        try {            Date parsedStartTime = timeParser.parse(startTimeString);            startTime = Calendar.getInstance(TimeZone.getTimeZone("UTC"));            startTime.setTime(parsedStartTime);            if (weeklySession) {                startDay = startTime.get(Calendar.DAY_OF_WEEK);            }        } catch (ParseException e) {            throw new ConfigError("Session " + sessionID + ": could not parse start time '" + startTimeString + "'.");        }        try {            Date parsedEndTime = timeParser.parse(endTimeString);            endTime = Calendar.getInstance(TimeZone.getTimeZone("UTC"));            endTime.setTime(parsedEndTime);            if (weeklySession) {                endDay = endTime.get(Calendar.DAY_OF_WEEK);            }        } catch (ParseException e) {            throw new ConfigError("Session " + sessionID + ": could not parse end time '" + endTimeString + "'.");        }    }