Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 5b892df8552a6be41c77c7b41b555fd98c1438e7 1 parent 493f480
Oleg Kalnichevski authored November 22, 2011
4  dom/src/main/java/org/apache/james/mime4j/field/DateTimeFieldLenientImpl.java
@@ -39,8 +39,8 @@
39 39
 public class DateTimeFieldLenientImpl extends AbstractField implements DateTimeField {
40 40
 
41 41
     private static final String[] DEFAULT_DATE_FORMATS =  { 
42  
-        "EEE, dd MMM yyyy hh:mm:ss ZZZZ", 
43  
-        "dd MMM yyyy hh:mm:ss ZZZZ"};
  42
+        "EEE, dd MMM yyyy HH:mm:ss ZZZZ", 
  43
+        "dd MMM yyyy HH:mm:ss ZZZZ"};
44 44
 
45 45
     private final List<String> datePatterns;
46 46
 
5  dom/src/test/java/org/apache/james/mime4j/field/LenientDateTimeFieldTest.java
@@ -47,5 +47,10 @@ public void testDateDSTNoDayOfWeek() throws Exception  {
47 47
         DateTimeField f = parse("Date: 16 Jul 2008 17:12:33 +0200");
48 48
         assertEquals(new Date(1216221153000L), f.getDate());
49 49
     }
  50
+    
  51
+    public void testdd() throws Exception {
  52
+        DateTimeField f = parse("Date: Thu, 01 Jan 1970 12:00:00 +0000");
  53
+        assertEquals(43200000L, f.getDate().getTime());
  54
+    }
50 55
 
51 56
 }

0 notes on commit 5b892df

Please sign in to comment.
Something went wrong with that request. Please try again.