2005-04-20 Sven de Marothy <sven@physto.se>
authorSven de Marothy <sven@physto.se>
Wed, 20 Apr 2005 06:01:09 +0000 (08:01 +0200)
committerMichael Koch <mkoch@gcc.gnu.org>
Wed, 20 Apr 2005 06:01:09 +0000 (06:01 +0000)
* java/text/SimpleDateFormat.java:
(formatWithAttribute): Pad year before truncating digits.

From-SVN: r98444

libjava/ChangeLog
libjava/java/text/SimpleDateFormat.java

index aeca35fb08aba3eef6e1e594118d0e4af1e4d039..203ea97305418f1e5f127a4c0a8a5f83354f2474 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-20  Sven de Marothy  <sven@physto.se>
+
+       * java/text/SimpleDateFormat.java:
+       (formatWithAttribute): Pad year before truncating digits.
+
 2005-04-20  Michael Koch  <konqueror@gmx.de>
 
        * gnu/java/net/PlainDatagramSocketImpl.java:
index 190b4d624f4759efd537dd1254a731463001a633..06275b628ca61db06610476a7bc2f2ceca2ba934 100644 (file)
@@ -680,7 +680,7 @@ public class SimpleDateFormat extends DateFormat
                buffer.setDefaultAttribute (DateFormat.Field.YEAR);
                if (cf.getSize() == 2)
                  {
-                   temp = String.valueOf (calendar.get (Calendar.YEAR));
+                   temp = "00"+String.valueOf (calendar.get (Calendar.YEAR));
                    buffer.append (temp.substring (temp.length() - 2));
                  }
                else