且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Android 5.0 Jodatime问题

更新时间:2023-02-24 20:35:12

这是一个可能的定位问题即可。看来,你的默认本地不知道AM-string,但别的东西。

This is probably a localization issue. It appears that your default local does not know the "AM"-string, but something else.

乔达时仅委派给底层的JVM的资源,你的情况到Android资源可以是不同的。要做到这一点,乔达时最后用类的DateFormatSymbols 。请检查您的语言环境和 getAmPmStrings的输出()对于正确的诊断。

Joda-Time just delegates to the underlying JVM-resource, in your case to the Android-resources which can be different. To do so, Joda-Time finally uses the class DateFormatSymbols. Please check your locale and the output of getAmPmStrings() for a proper diagnosis.

在诊断结果依赖通过使用显式设置区域 LocalTime.parse(timeToParse,fmt.withLocale(区域设置区域设置)); 帮助,或者您使用一个合适的形式字符串输入preprocessing的。

Dependent on the result of the diagnosis either setting the locale explicitly by using LocalTime.parse(timeToParse, fmt.withLocale(Locale locale)); helps, or you use a suitable form of string input preprocessing.