Author: carnold
Date: Tue Mar 28 10:48:04 2006
New Revision: 389573
URL: http://svn.apache.org/viewcvs?rev=389573&view=rev
Log:
Bug 39135: Bad patterns in ISO8601DateFormat and DateTimeDateFormat
Modified:
logging/log4j/branches/v1_2-branch/src/java/org/apache/log4j/helpers/DateTimeDateFormat.java
logging/log4j/branches/v1_2-branch/src/java/org/apache/log4j/helpers/ISO8601DateFormat.java
logging/log4j/branches/v1_2-branch/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java
Modified:
logging/log4j/branches/v1_2-branch/src/java/org/apache/log4j/helpers/DateTimeDateFormat.java
URL:
http://svn.apache.org/viewcvs/logging/log4j/branches/v1_2-branch/src/java/org/apache/log4j/helpers/DateTimeDateFormat.java?rev=389573&r1=389572&r2=389573&view=diff
==============================================================================
---
logging/log4j/branches/v1_2-branch/src/java/org/apache/log4j/helpers/DateTimeDateFormat.java
(original)
+++
logging/log4j/branches/v1_2-branch/src/java/org/apache/log4j/helpers/DateTimeDateFormat.java
Tue Mar 28 10:48:04 2006
@@ -24,7 +24,7 @@
import java.text.DateFormatSymbols;
/**
- Formats a [EMAIL PROTECTED] Date} in the format "dd MMM YYYY HH:mm:ss,SSS"
for example,
+ Formats a [EMAIL PROTECTED] Date} in the format "dd MMM yyyy HH:mm:ss,SSS"
for example,
"06 Nov 1994 15:49:37,459".
@author Ceki Gülcü
@@ -47,7 +47,7 @@
}
/**
- Appends to <code>sbuf</code> the date in the format "dd MMM YYYY
+ Appends to <code>sbuf</code> the date in the format "dd MMM yyyy
HH:mm:ss,SSS" for example, "06 Nov 1994 08:49:37,459".
@param sbuf the string buffer to write to
Modified:
logging/log4j/branches/v1_2-branch/src/java/org/apache/log4j/helpers/ISO8601DateFormat.java
URL:
http://svn.apache.org/viewcvs/logging/log4j/branches/v1_2-branch/src/java/org/apache/log4j/helpers/ISO8601DateFormat.java?rev=389573&r1=389572&r2=389573&view=diff
==============================================================================
---
logging/log4j/branches/v1_2-branch/src/java/org/apache/log4j/helpers/ISO8601DateFormat.java
(original)
+++
logging/log4j/branches/v1_2-branch/src/java/org/apache/log4j/helpers/ISO8601DateFormat.java
Tue Mar 28 10:48:04 2006
@@ -25,7 +25,7 @@
// Contributors: Arndt Schoenewald <[EMAIL PROTECTED]>
/**
- Formats a [EMAIL PROTECTED] Date} in the format "YYYY-mm-dd HH:mm:ss,SSS"
for example
+ Formats a [EMAIL PROTECTED] Date} in the format "yyyy-MM-dd HH:mm:ss,SSS"
for example
"1999-11-27 15:49:37,459".
<p>Refer to the <a
Modified:
logging/log4j/branches/v1_2-branch/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java
URL:
http://svn.apache.org/viewcvs/logging/log4j/branches/v1_2-branch/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java?rev=389573&r1=389572&r2=389573&view=diff
==============================================================================
---
logging/log4j/branches/v1_2-branch/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java
(original)
+++
logging/log4j/branches/v1_2-branch/tests/src/java/org/apache/log4j/helpers/DateLayoutTest.java
Tue Mar 28 10:48:04 2006
@@ -24,6 +24,7 @@
import java.text.SimpleDateFormat;
import java.util.TimeZone;
+import java.util.Date;
/**
@@ -214,6 +215,27 @@
DateFormat format = new SimpleDateFormat("HH:mm");
DateLayout layout = (DateLayout) createLayout();
layout.setDateFormat(format, TimeZone.getDefault());
+ }
+
+
+ /**
+ * Tests IS08601DateFormat class.
+ * @deprecated since ISO8601DateFormat is deprecated
+ */
+ public void testISO8601Format() {
+ DateFormat format = new ISO8601DateFormat();
+ String actual = format.format(new
Date(-TimeZone.getDefault().getOffset(0)));
+ assertEquals("1970-01-01 00:00:00,000", actual);
+ }
+
+ /**
+ * Tests DateTimeDateFormat class.
+ * @deprecated since DateTimeDateFormat is deprecated
+ */
+ public void testDateTimeFormat() {
+ DateFormat format = new DateTimeDateFormat();
+ String actual = format.format(new
Date(-TimeZone.getDefault().getOffset(0)));
+ assertEquals("01 Jan 1970 00:00:00,000", actual);
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]