protected static Date handleDateSpecification(String specification) throws NumberFormatException, ParseException {
		if (specification == null)
			return null;
		else if (specification.toLowerCase().startsWith("in ")) {
			specification = specification.substring(3).trim().replace(" +", "").toLowerCase();
			long expiryUnit = 1;
			if (specification.endsWith("h")) {
				expiryUnit = 60 * 60 * 1000;
				specification = specification.substring(0, specification.length() - 1);
			} else if (specification.endsWith("d")) {
				expiryUnit = 24 * 60 * 60 * 1000;
				specification = specification.substring(0, specification.length() - 1);
			} else if (specification.endsWith("w")) {
				expiryUnit = 7 * 24 * 60 * 60 * 1000;
				specification = specification.substring(0, specification.length() - 1);
			} else if (specification.endsWith("m")) {
				expiryUnit = (long) (30.436875 * 24 * 60 * 60 * 1000);
				specification = specification.substring(0, specification.length() - 1);
			} else if (specification.endsWith("y")) {
				expiryUnit = (long) (365.2425 * 24 * 60 * 60 * 1000);
				specification = specification.substring(0, specification.length() - 1);
			}
			long expiryCount = Long.parseLong(specification);
			return new Date(-expiryCount * expiryUnit);
		} else
			return MediaWiki.timestampToDate(specification);
	}