public static Date getCurrentDate(Context context) throws GeneralException {

        URI propName = Constants.ENVIRONMENT.CURRENT_DATE_TIME.attributeId;
        String dateTimeValue = context.getEnvironmentValue(propName);
        if (dateTimeValue == null) {
            throw new GeneralException("Missing value for environment "
                    + "context attribute: " + propName);
        }

        try {
            return DateUtility.parseDateStrict(dateTimeValue);
        } catch (ParseException e) {
            throw new GeneralException(e.getMessage());
        }
    }
public static Date getCurrentDate ( Context context ) throws GeneralException { URI propName = Constants . ENVIRONMENT . CURRENT_DATE_TIME . attributeId ; String dateTimeValue = context . getEnvironmentValue ( propName ) ; if ( dateTimeValue == null ) { throw new GeneralException ( "Missing value for environment " + "context attribute: " + propName ) ; } try { return DateUtility . parseDateStrict ( dateTimeValue ) ; } catch ( ParseException e ) { throw new GeneralException ( e . getMessage ( ) ) ; } }
Get the current date from the context. If the context doesn't specify a
value for the current date, or the specified value cannot be parsed as an
ISO8601 date string, a GeneralException will be thrown.