Permalink
Browse files

MIME4J-208: DateTimeFieldLenientImpl used incorrect date-time format

git-svn-id: https://svn.apache.org/repos/asf/james/mime4j/trunk@1204864 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
ok2c committed Nov 22, 2011
1 parent 493f480 commit 5b892df8552a6be41c77c7b41b555fd98c1438e7
@@ -39,8 +39,8 @@
public class DateTimeFieldLenientImpl extends AbstractField implements DateTimeField {
private static final String[] DEFAULT_DATE_FORMATS = {
- "EEE, dd MMM yyyy hh:mm:ss ZZZZ",
- "dd MMM yyyy hh:mm:ss ZZZZ"};
+ "EEE, dd MMM yyyy HH:mm:ss ZZZZ",
+ "dd MMM yyyy HH:mm:ss ZZZZ"};
private final List<String> datePatterns;
@@ -47,5 +47,10 @@ public void testDateDSTNoDayOfWeek() throws Exception {
DateTimeField f = parse("Date: 16 Jul 2008 17:12:33 +0200");
assertEquals(new Date(1216221153000L), f.getDate());
}
+
+ public void testdd() throws Exception {
+ DateTimeField f = parse("Date: Thu, 01 Jan 1970 12:00:00 +0000");
+ assertEquals(43200000L, f.getDate().getTime());
+ }
}

0 comments on commit 5b892df

Please sign in to comment.