0

I'm stuggling to convert String 'Tue Jan 01 01:01:00 GMT 2013' into a date format. I tried to use simple date class, but it didn't succeed.

String st=list[1];
Date start = new SimpleDateFormat("EEE MM dd yyyy HH:mm:ss zzz yyyy").parse(list[1]);

Maybe someone can find my mistake or recommend something else. thanx in advance

2 Answers 2

1

I think you want

new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy")

and I would perhaps check the doc. Beware also that SimpleDateFormat isn' thread-safe and you may prefer to use the Joda-Time equivalents.

Sign up to request clarification or add additional context in comments.

Comments

0

I think you need to replace zzzwith Z

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.