forum

home / developersection / forums / java string to date conversion

Java string to date conversion

Mark Devid 2124 10-Aug-2015
Can somebody recommend the best way to convert a string in the format 'January 2, 2010' to a date in java? Ultimately, I want to break out the month, the day, and the year as integers so that I can use:

Date date = new Date();
date.setMonth()..
date.setYear()..
date.setDay()..
date.setlong currentTime = date.getTime();
to convert the date into time.

Updated on 10-Aug-2015
Can you answer this question?

Answer

1 Answers

Liked By