File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

to convert string to date

 
anupama rc
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pls help me out with this problem....i am accepting the date as a string thro an html form and want to convert into date object.....

------------------
anu
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by anupama rc:
pls help me out with this problem....i am accepting the date as a string thro an html form and want to convert into date object.....

I don't quite understand this. One of the very first sentences in the javadoc for Date is: As of JDK 1.1, the Calendar class should be used to convert between dates and time fields and the DateFormat class should be used to format and parse date strings.
One of the examples given in the introduction to the DateFormat class is: You can use a DateFormat to parse also.
   myDate = df.parse(myString);

If you don't have the JDK documentation installed on your machine, then please fix this.
Besides, this question has nothing whatsoever to do with servlets and JSPs. If you're reading documentation anyway you might want to read this as well.
- Peter
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic