@Test public void testParseDateSampleDate() { String printed = "Tue, 22 Oct 2013 19:28:45 GMT"; Date date = URLFetchUtils.parseDate(printed); assertNotNull(date); DateTimeFormatter gcsFormat = DateTimeFormat.forPattern("EEE, dd MMM yyyy HH:mm:ss z").withZoneUTC() .withLocale(Locale.US); assertEquals(printed.substring(0, printed.length() - 4), gcsFormat.print(date.getTime()).substring(0, printed.length() - 4)); }
static Date parseDate(String dateString) { try { return DATE_FORMAT.parseDateTime(dateString).toDate(); } catch (IllegalArgumentException e) { return null; } }
URLFetchUtils { static Date parseDate(String dateString) { try { return DATE_FORMAT.parseDateTime(dateString).toDate(); } catch (IllegalArgumentException e) { return null; } } }
URLFetchUtils { static Date parseDate(String dateString) { try { return DATE_FORMAT.parseDateTime(dateString).toDate(); } catch (IllegalArgumentException e) { return null; } } private  URLFetchUtils(); }
URLFetchUtils { static Date parseDate(String dateString) { try { return DATE_FORMAT.parseDateTime(dateString).toDate(); } catch (IllegalArgumentException e) { return null; } } private  URLFetchUtils();  }
URLFetchUtils { static Date parseDate(String dateString) { try { return DATE_FORMAT.parseDateTime(dateString).toDate(); } catch (IllegalArgumentException e) { return null; } } private  URLFetchUtils();   }