short patch for Date class
Jiro KANAYAMA
majiro at distribution.co.jp
Mon Jun 7 11:15:01 PDT 1999
Hi all.
Here is a short patch for Date class.
Index: Date.java
===================================================================
RCS file: /home/cvspublic/kaffe/libraries/javalib/java/util/Date.java,v
retrieving revision 1.10
diff -u -r1.10 Date.java
--- Date.java 1999/05/16 21:39:25 1.10
+++ Date.java 1999/06/07 18:20:09
@@ -263,7 +263,7 @@
* @deprecated
*/
public String toGMTString() {
- DateFormat form = DateFormat.getDateTimeInstance();
+ DateFormat form = new SimpleDateFormat("d MMM yyyy HH:mm:ss 'GMT'");
form.setTimeZone(TimeZone.getTimeZone("GMT"));
return (form.format(this));
}
@@ -272,14 +272,12 @@
* @deprecated
*/
public String toLocaleString() {
- DateFormat form = DateFormat.getDateTimeInstance();
- form.setTimeZone(TimeZone.getDefault());
+ DateFormat form = new SimpleDateFormat("yyyy/MM/dd H:mm:ss");
return (form.format(this));
}
public String toString() {
- // need a string of the form: "Thu May 13 17:52:20 MDT 1999"
- SimpleDateFormat form = new SimpleDateFormat("E MMM dd HH:mm:ss z yyyy");
+ DateFormat form = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
return (form.format(this));
}
}
More information about the kaffe
mailing list