aspose file tools
The moose likes Java in General and the fly likes Date Converting String to Date Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Date Converting String to Date" Watch "Date Converting String to Date" New topic
Author

Date Converting String to Date

Abiodun Adisa
Ranch Hand

Joined: Jan 17, 2002
Posts: 495
In my application to convert from String to Date

I have the following



It works problem is , the compiler shows a warning that the Constructor new Date(String) is deprecated, please can some one suggest an alternative way to convert from String to date
satishkumar janakiraman
Ranch Hand

Joined: May 03, 2004
Posts: 334
You can use DateFormat or SimpleDateFormat instead of Date.

Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 681
Haven't got a code example for you, but here is how you could lookup how to do it. In the java API doc, look at the Index (one of the links at the top of the doc page) for the parse() method. If you scan down thru all the different parse methods you'll see one that returns a Date object.
 
I agree. Here's the link: jrebel
 
subject: Date Converting String to Date
 
Similar Threads
character escape question...help plz..
Problem getting correct date format
URGENT - converting bytes to Strings
Reading through socket problem
NoClassDefFoundError