3

i'm have string dates like Wed Aug 17 17:22:51 IST 2016 to parse to ISOdate. so I have tried following code to do that.

String tdate = "Wed Aug 17 17:22:51 IST 2016";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
Date pubDate = sdf.parse(tdate);

but it gave me:

java.text.ParseException: Unparseable date: "Wed Aug 17 17:22:51 IST 2016"

1 Answer 1

2

try parsing with

SimpleDateFormat sdf = new SimpleDateFormat("E MMM dd HH:mm:ss Z yyyy");

hope it helped

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

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.