Commit ce254988 by Sven de Marothy Committed by Michael Koch

2005-04-20 Sven de Marothy <sven@physto.se>

	* java/text/SimpleDateFormat.java:
	(formatWithAttribute): Pad year before truncating digits.

From-SVN: r98444
parent 47af138f
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> 2005-04-20 Michael Koch <konqueror@gmx.de>
* gnu/java/net/PlainDatagramSocketImpl.java: * gnu/java/net/PlainDatagramSocketImpl.java:
......
...@@ -680,7 +680,7 @@ public class SimpleDateFormat extends DateFormat ...@@ -680,7 +680,7 @@ public class SimpleDateFormat extends DateFormat
buffer.setDefaultAttribute (DateFormat.Field.YEAR); buffer.setDefaultAttribute (DateFormat.Field.YEAR);
if (cf.getSize() == 2) 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)); buffer.append (temp.substring (temp.length() - 2));
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment