src/org/ohmage/validator/ObserverValidators.java
public static final DateTime validateDate(
			final String value)
			throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return null;
		}
		
		try {
			return DATE_TIME_FORMATTER.parseDateTime(value);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
				ErrorCode.SERVER_INVALID_DATE,
				"The date was invalid: " + value,
				e);
		}
	}
/**
	 * Validates that a date is a valid date with or without time.
	 * 
	 * @param value The value to validate.
	 * 
	 * @return A DateTime representing the date and time or null if the value
	 * 		   was null or only whitespace.
	 * 
	 * @throws ValidationException The value is not null or whitespace and 
	 * 							   could not be decoded.
	 */
Validates that a date is a valid date with or without time.

@param value The value to validate.

@return A DateTime representing the date and time or null if the value
was null or only whitespace.

@throws ValidationException The value is not null or whitespace and
could not be decoded.
Validates that a date is a valid date with or without time . @param value The value to validate . @return A DateTime representing the date and time or null if the value was null or only whitespace . @throws ValidationException The value is not null or whitespace and could not be decoded .
public static final DateTime validateDate(
			final String value)
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return null;
		}
		try {
			return DATE_TIME_FORMATTER.parseDateTime(value);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
				ErrorCode.SERVER_INVALID_DATE,
				"The date was invalid: " + value,
				e);
		}
	}
public static final DateTime validateDate ( final String value ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( value ) ) { return null ; } try { return DATE_TIME_FORMATTER . parseDateTime ( value ) ; } catch ( IllegalArgumentException e ) { throw new ValidationException ( ErrorCode . SERVER_INVALID_DATE , "The date was invalid: " + value , e ) ; } }
Validates that a date is a valid date with or without time.
Validates that a date is a valid date with or without time .