您可以改用Joda Time。它
DateTimeFormat具有
ZZ可以满足您需求的format属性。
链接
最大优点:与不同
SimpleDateFormat,
DateTimeFormatter线程安全。用法:
DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ssZZ") .withLocale(Locale.ENGLISH);
您可以改用Joda Time。它
DateTimeFormat具有
ZZ可以满足您需求的format属性。
链接
最大优点:与不同
SimpleDateFormat,
DateTimeFormatter线程安全。用法:
DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ssZZ") .withLocale(Locale.ENGLISH);