Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Elahe Shafie
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,
What is the Purpose of these two lines:
...
long l = Date.parse( strWork );
dateWork = new Date(l);
Many thanks,
Elham
 
Mahesh Mamani
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question isn't JDBC-specific, so I'm moving it to the Java in General (beginner) forum.
 
Elahe Shafie
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure many thanks for your help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic