DateKit { public static Date parseHttpDateFormat(String httpDateFormat) throws IllegalArgumentException { return parseHttpDateFormatToDateTime(httpDateFormat).toDate(); } 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 testParseHttpDateFormat() throws Exception { assertEquals(new Date(0L).toString(), DateKit.parseHttpDateFormat("Thu, 01 Jan 1970 00:00:00 GMT").toString()); assertEquals(new Date(1346839077523L).toString(), DateKit.parseHttpDateFormat("Wed, 05 Sep 2012 09:57:57 GMT").toString()); }