Changed email date locale

This commit is contained in:
Ziver Koc 2017-01-20 00:42:53 +01:00
parent 3d04dba4fd
commit 7664b4bf00
2 changed files with 4 additions and 3 deletions

View file

@ -4,6 +4,7 @@ import java.io.IOException;
import java.io.Writer;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.regex.Pattern;
import static zutil.net.smtp.SMTPClient.NEWLINE;
@ -20,7 +21,7 @@ public class Email {
PLAIN, HTML
}
private static final SimpleDateFormat dateFormatter =
new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");
new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z", Locale.ENGLISH);
private static final Pattern PATTERN_NEWLINE = Pattern.compile("(\\r\\n|\\n)");
private String fromAddress;

View file

@ -86,7 +86,7 @@ public class EmailTest {
assertEquals(
"From: test@example.com" + NEWLINE +
"To: to@example.com" + NEWLINE +
"Date: on, 22 nov 2000 15:20:55 +0100" + NEWLINE +
"Date: Wed, 22 Nov 2000 15:20:55 +0100" + NEWLINE +
"Content-Type: text/plain;" + NEWLINE +
"Subject: " + NEWLINE +
NEWLINE +
@ -109,7 +109,7 @@ public class EmailTest {
"From: Test Tester <test@example.com>" + NEWLINE +
"Reply-To: <mokey@example.org>" + NEWLINE +
"To: To Totter <to@example.com>" + NEWLINE +
"Date: on, 22 nov 2000 15:20:55 +0100" + NEWLINE +
"Date: Wed, 22 Nov 2000 15:20:55 +0100" + NEWLINE +
"Content-Type: text/html;" + NEWLINE +
"Subject: Title" + NEWLINE +
NEWLINE +