This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Servlets and the fly likes to convert string to date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "to convert string to date" Watch "to convert string to date" New topic
Author

to convert string to date

anupama rc
Greenhorn

Joined: Mar 01, 2001
Posts: 3
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


anu
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
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
 
subject: to convert string to date
 
Similar Threads
String to Date?
String conversion
how to convert String into Date format
How to store datetimepicker value into database
String to Date conversion