wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: to convert string to date
 
Similar Threads
String to Date conversion
String conversion
how to convert String into Date format
How to store datetimepicker value into database
String to Date?