xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r619441 - in /xmlgraphics/commons/trunk: src/java/org/apache/xmlgraphics/xmp/XMPSchemaAdapter.java test/java/org/apache/xmlgraphics/xmp/DateFormattingTest.java
Date Thu, 07 Feb 2008 15:19:36 GMT
Author: jeremias
Date: Thu Feb  7 07:19:27 2008
New Revision: 619441

URL: http://svn.apache.org/viewvc?rev=619441&view=rev
Log:
Let's play on the safe side.

Modified:
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaAdapter.java
    xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/xmp/DateFormattingTest.java

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaAdapter.java?rev=619441&r1=619440&r2=619441&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaAdapter.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaAdapter.java Thu
Feb  7 07:19:27 2008
@@ -24,6 +24,7 @@
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
+import java.util.Locale;
 import java.util.TimeZone;
 
 import org.apache.xmlgraphics.util.QName;
@@ -33,10 +34,11 @@
  */
 public class XMPSchemaAdapter {
 
-    private static DateFormat pseudoISO8601DateFormat = new SimpleDateFormat(
-                                                            "yyyy'-'MM'-'dd'T'HH':'mm':'ss");
+    private static DateFormat pseudoISO8601DateFormat;
 
     static {
+        pseudoISO8601DateFormat = new SimpleDateFormat(
+                "yyyy'-'MM'-'dd'T'HH':'mm':'ss", Locale.ENGLISH);
         pseudoISO8601DateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
     }
     
@@ -130,7 +132,7 @@
      */
     public static String formatISO8601Date(Date dt, TimeZone tz) {
         //ISO 8601 cannot be expressed directly using SimpleDateFormat
-        Calendar cal = Calendar.getInstance(tz);
+        Calendar cal = Calendar.getInstance(tz, Locale.ENGLISH);
         cal.setTime(dt);
         int offset = cal.get(Calendar.ZONE_OFFSET);
         offset += cal.get(Calendar.DST_OFFSET);

Modified: xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/xmp/DateFormattingTest.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/xmp/DateFormattingTest.java?rev=619441&r1=619440&r2=619441&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/xmp/DateFormattingTest.java
(original)
+++ xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/xmp/DateFormattingTest.java
Thu Feb  7 07:19:27 2008
@@ -21,6 +21,7 @@
 
 import java.util.Calendar;
 import java.util.Date;
+import java.util.Locale;
 import java.util.TimeZone;
 
 import junit.framework.TestCase;
@@ -35,7 +36,7 @@
      * @throws Exception if an error occurs
      */
     public void testDateFormatting() throws Exception {
-        Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
+        Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"), Locale.ENGLISH);
         cal.set(2008, Calendar.FEBRUARY, 07, 15, 11, 07);
         cal.set(Calendar.MILLISECOND, 0);
         Date dt = cal.getTime();



---------------------------------------------------------------------
Apache XML Graphics Project URL: http://xmlgraphics.apache.org/
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Mime
View raw message