android problem with SimpleDateFormat TimeZone
Let's开发者_运维百科 consider this code sample:
DateFormat sdf = SimpleDateFormat.getTimeInstance(SimpleDateFormat.LONG,
new Locale("ru", "RU"));
Date date = sdf.parse("8:13:05 PDT");
When I run this code on my desktop(java 1.6) all passes well, however on android devices I get exception, I think this is due to locale TimeZone:
java.text.ParseException: Unparseable date: 8:13:05 PDT
Why?
I don't believe UNIX can parse the PDT timezone. I'm having the same issue. It can handle PST & PST8PDT, but not PDT. I believe the recommended solution is to use PST8PDT instead.
精彩评论