Related questions
Change date format in a Java string
I've a String representing a date.
String date_s = "2011-01-18 00:00:00.0";
I'd like to convert it to a Date and output it in YYYY-MM-DD format.
2011-01-18
How can I achieve this?
Okay, based on the answers I retrieved below, …
Java string to date conversion
What is 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 …
how to convert java string to Date object
I have a string
String startDate = "06/27/2007";
now i have to get Date object. My DateObject should be the same value as of startDate.
I am doing like this
DateFormat df = new SimpleDateFormat("mm/dd/yyyy");
Date startDate = df.parse(startDate);
…