سؤال

This throws an Invalid format exception:

DateTimeFormat.forPattern("%E, %d %M %Y %H:%m:%s %z").parseMillis("Sun, 20 May 2012 01:07:11 +0000")

Why doesn't it work? According to the spec, it seems like it should work.

هل كانت مفيدة؟

المحلول 2

I think the pattern should be more like:

EEE, dd MMM YYYY HH:mm:ss Z

نصائح أخرى

It's because of that your z parameter is wrong. It should be PST, for example. Either capitalize it (use Z) or change the input string.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top