protected static long convertToLong(final String dateHeader) {
if (dateHeader == null)
return (-1L);
final SimpleDateFormats formats = SimpleDateFormats.create();
try {
// Attempt to convert the date header in a variety of formats
long result = FastHttpDateFormat.parseDate(dateHeader, formats.getFormats());
if (result != (-1L)) {
return result;
}
throw new IllegalArgumentException(dateHeader);
} finally {
formats.recycle();
}
}