diff --git a/src/eu/siacs/conversations/generator/MessageGenerator.java b/src/eu/siacs/conversations/generator/MessageGenerator.java index a0bb7fb8e..419db25a7 100644 --- a/src/eu/siacs/conversations/generator/MessageGenerator.java +++ b/src/eu/siacs/conversations/generator/MessageGenerator.java @@ -2,6 +2,7 @@ package eu.siacs.conversations.generator; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.Locale; import java.util.TimeZone; import net.java.otr4j.OtrException; @@ -33,7 +34,7 @@ public class MessageGenerator { } private void addDelay(MessagePacket packet, long timestamp) { - final SimpleDateFormat mDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); + final SimpleDateFormat mDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",Locale.US); mDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); Element delay = packet.addChild("delay", "urn:xmpp:delay"); Date date = new Date(timestamp); diff --git a/src/eu/siacs/conversations/parser/AbstractParser.java b/src/eu/siacs/conversations/parser/AbstractParser.java index c06a5cbd9..f9a7b1c0e 100644 --- a/src/eu/siacs/conversations/parser/AbstractParser.java +++ b/src/eu/siacs/conversations/parser/AbstractParser.java @@ -3,8 +3,8 @@ package eu.siacs.conversations.parser; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.Locale; -import android.util.Log; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.services.XmppConnectionService; @@ -26,7 +26,7 @@ public abstract class AbstractParser { "stamp"); stamp = stamp.replace("Z", "+0000"); if (stamp.contains(".")) { - Date date = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") + Date date = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ",Locale.US) .parse(stamp); if (now