Java SystemV时区和JodaTime [英] Java SystemV timezones and JodaTime

查看:134
本文介绍了Java SystemV时区和JodaTime的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JodaTime在Java应用程序中处理时区.尝试从Java时区的ID构建DateTimeZone(JodaTime)对象时遇到问题.乔达抛出

I am working with timezones in a Java application using JodaTime. I encounter a problem when trying to build a DateTimeZone (JodaTime) object from the id of a java timezone. Joda throws a

 java.lang.IllegalArgumentException: The datetime zone id 'SystemV/HST10' is not recognised

以下时区列表:

  • SystemV/HST10
  • SystemV/YST9
  • SystemV/YST9YDT
  • SystemV/PST8
  • SystemV/PST8PDT
  • SystemV/MST7
  • SystemV/MST7MDT
  • SystemV/CST6
  • SystemV/CST6CDT
  • SystemV/EST5
  • SystemV/EST5EDT
  • SystemV/AST4
  • SystemV/AST4ADT
  • SystemV/HST10
  • SystemV/YST9
  • SystemV/YST9YDT
  • SystemV/PST8
  • SystemV/PST8PDT
  • SystemV/MST7
  • SystemV/MST7MDT
  • SystemV/CST6
  • SystemV/CST6CDT
  • SystemV/EST5
  • SystemV/EST5EDT
  • SystemV/AST4
  • SystemV/AST4ADT

这些时区是做什么用的?它们与非程序员有关吗?专为一般用途设计的应用程序应支持这些时区吗?

What are these timezones used for? Are they relevant to non-programmers? Should an application designed for general uses support these timezones?

谢谢.

推荐答案

SystemV时区ID旧且已弃用.但是,您可以通过重新编译 joda-time jar来使Joda-Time了解它们.包含systemv时区数据文件的文件.参见评论系统数据文件中的第行. (即取消注释行并重建jar文件).

The SystemV time-zone IDs are old and deprecated. However, you can make Joda-Time understand them by re-compiling the joda-time jar file with the systemv time-zone data file included. See the commented out lines in the systemv data file. (ie. uncomment the lines and rebuild the jar file).

这篇关于Java SystemV时区和JodaTime的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆