I have a String as
strikedate="2011-11-19T00:00:00.000-05:00"
I need to put this into a java.util.Date
Could anybody please tell me how to convert this String to Date
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sure – use
SimpleDateFormat.EDIT: Eek – it’s not quite that simple, due to your time zone format. The above will work without the colon. You may need to use Joda Time to parse the version with the colon. Checking that now…
EDIT: Yes, with Joda Time you can use:
Joda Time is also a much nicer date/time API to start with – I’d strongly encourage you to use it if you can.