We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.在中文环境下,使用TimeUtils.millis2String(long millis, @nonnull final String pattern)方法,pattern传入:h:mm a,获取到的时间能正常显示,如:8:00上午 2.切换系统语言为其他语言,此时重复上面的步骤,获取到的时间显示不对,在其他语言环境下,仍显示:8:00上午,显示错误
查看源码,TimeUtils类里的SDF_THREAD_LOCAL里面已经缓存了SimpleDateFormat,切换语言时,因为h:mm a使用过,缓存在SDF_THREAD_LOCAL,不会重新添加,但此时的simpleDateFormat是在中文环境创建的,导致出来的时间一直是中文,切换了语言也不会变……
The text was updated successfully, but these errors were encountered:
Blankj
No branches or pull requests
描述 Bug
1.在中文环境下,使用TimeUtils.millis2String(long millis, @nonnull final String pattern)方法,pattern传入:h:mm a,获取到的时间能正常显示,如:8:00上午
2.切换系统语言为其他语言,此时重复上面的步骤,获取到的时间显示不对,在其他语言环境下,仍显示:8:00上午,显示错误
查看源码,TimeUtils类里的SDF_THREAD_LOCAL里面已经缓存了SimpleDateFormat,切换语言时,因为h:mm a使用过,缓存在SDF_THREAD_LOCAL,不会重新添加,但此时的simpleDateFormat是在中文环境创建的,导致出来的时间一直是中文,切换了语言也不会变……
The text was updated successfully, but these errors were encountered: