Dear Friends, What is the Purpose of these two lines: ... long l = Date.parse( strWork ); dateWork = new Date(l); Many thanks, Elham
Thanks,
Elahe
Mahesh Mamani
Ranch Hand
Joined: Jun 25, 2001
Posts: 110
posted
0
Hi, I think u r trying to convert a String into Date format. For this, the code which u have posted first converts the string into long and then this long is passed to Date constructor. If u look at the API, then u can c that the Date(String s) constructor is deprecated. " Date(String s) Deprecated. As of JDK version 1.1, replaced by DateFormat.parse(String s)."
So, pls use DateFormat.parse(String s) for your intended purpose. Thanks Mahesh