DateKit { public static DateTime parseHttpDateFormatToDateTime(String httpDateFormat) throws IllegalArgumentException { return RFC1123_DATE_FORMAT.parseDateTime(httpDateFormat); } private  DateKit(); static String formatDashYMDHMS(Date date); static Date parseDashYMDHMS(String httpDateFormat); static DateTime parseDashYMDHMSDateTime(String httpDateFormat); static String formatDashYMD(Date date); static Date parseDashYMD(String httpDateFormat); static DateTime parseDashYMDDateTime(String httpDateFormat); static String formatDashYMDHM(Date date); static Date parseDashYMDHM(String httpDateFormat); static DateTime parseDashYMDHMDateTime(String httpDateFormat); static String formatForHttpHeader(Date date); static String formatForHttpHeader(Long unixTime); static Date parseHttpDateFormat(String httpDateFormat); static DateTime parseHttpDateFormatToDateTime(String httpDateFormat); static Long getUnixTimeAfterDay(int day); static Long getUnixTimeBeforeDay(int day); static Long getCurrentUnixTime();  }
@Test public void testParseHttpDateFormatToDateTime() throws Exception { assertEquals(new DateTime(0L).toDate().toString(), DateKit.parseHttpDateFormatToDateTime("Thu, 01 Jan 1970 00:00:00 GMT").toDate().toString()); assertEquals(new DateTime(1346839077523L).toDate().toString(), DateKit.parseHttpDateFormatToDateTime("Wed, 05 Sep 2012 09:57:57 GMT").toDate().toString()); }