Java 中尴尬的日期格式
我在解析这个日期时遇到问题:
Satu, 30 Octo 2010 06:00:00 EDT
我认为可以,
EEEE, dd MMMM yyyy HH:mm:ss Z
但它不起作用。我想将其格式化为
Saturday, October 30, 2010
我一直在查看 http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html 作为我的资源
I'm having trouble parsing this date:
Satu, 30 Octo 2010 06:00:00 EDT
I think it would be
EEEE, dd MMMM yyyy HH:mm:ss Z
but it is not working. I would like to format it to
Saturday, October 30, 2010
I've been looking at http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html as my resource
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
老实说,我会放弃
Satu,
并从那时起进行解析。您不需要它,并且始终可以使用Calendar
来计算星期/月份/年份。请参阅此处了解 StringUtils 是什么。Honestly, I'd ditch the
Satu,
and just parse from then on. You don't need it and can always useCalendar
to figure out day of the week/month/year. See here for what StringUtils is.MMM 并不意味着“前三个字母”。
MMM 和 MMMMMMMMMMMMMM 是相同的。
所以你的输入应该像“Oct”或“October”
MMM doesn't mean "first three letter".
Both MMM and MMMMMMMMMMMMMM are same.
So your input should be like "Oct" or "October"