• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

to convert string to date

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic