Are you getting deprecation warnings with this code? It doesn't seem
to be using any deprecated methods.
----- Original Message -----
Sent: Tuesday, November 16, 1999 11:26
PM
Subject: Re: Deprecation of
java.util.Date methods
I'm
a bit confused, I am using the java.util.Date as follows and it works fine in
JDK 1.1.7B and jsdk2.1. How would I change this to make it current since
java.util.Data is interacting with Calendar?
Tom
Kochanowicz
Note: I would have posted seperately, but for some
reason most of my posts don't go through.
Calendar calendar1;
SimpleDateFormat
formatter1;
java.util.Date todaysDate;
// Format todaysDate
calendar1 =
Calendar.getInstance();
formatter1 = new
SimpleDateFormat("MM/dd/yy");
formatter1.setTimeZone(java.util.TimeZone.getDefault());
// bug fix so not PST & is CST
todaysDate =
calendar1.getTime();
|
int
|
getHours()
Deprecated. As
of JDK version 1.1, replaced by
Calendar.get(Calendar.HOUR_OF_DAY). |
int |
getMinutes()
Deprecated. As
of JDK version 1.1, replaced by
Calendar.get(Calendar.MINUTE). |
int |
getMonth()
Deprecated. As
of JDK version 1.1, replaced by
Calendar.get(Calendar.MONTH). |
int |
getSeconds()
Deprecated. As
of JDK version 1.1, replaced by
Calendar.get(Calendar.SECOND). |
Use Calendar but not a Date
yours, Andrew
----- Original Message -----
Sent: Tuesday, November 16, 1999 7:53
PM
Subject: Deprecation of
java.util.Date methods
Hello Everyone,
Can anyone tell me what is new method for
replacing the following:
java.util.Date myDate = new
java.util.Date();
String myString = myDate.getHours()
+ myDate.getMinutes() +
myDate.getSeconds();
I am using jdk1.2.2 . There is a warning that
these methods has been deprecated. I was unable to find anything on this
deprecation at sun's site.
Thanks,
*Antonio*