OSDN Git Service

2005-04-20 Sven de Marothy <sven@physto.se>
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Apr 2005 06:01:09 +0000 (06:01 +0000)
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Apr 2005 06:01:09 +0000 (06:01 +0000)
* java/text/SimpleDateFormat.java:
(formatWithAttribute): Pad year before truncating digits.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98444 138bc75d-0d04-0410-961f-82ee72b054a4

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

index aeca35f..203ea97 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 190b4d6..06275b6 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