my dog learned polymorphism*
The moose likes Beginning Java and the fly likes I don't know what is the purpose of..... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "I don Watch "I don New topic
Author

I don't know what is the purpose of.....

Elahe Shafie
Ranch Hand

Joined: Dec 12, 2001
Posts: 291
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
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
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

This question isn't JDBC-specific, so I'm moving it to the Java in General (beginner) forum.
Elahe Shafie
Ranch Hand

Joined: Dec 12, 2001
Posts: 291
Sure many thanks for your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I don't know what is the purpose of.....
 
Similar Threads
servlet annotation
include alt tags
Displaying images on JSP page
java API to parse JSP
Regarding configuration parameters problem