为了与 JDK 1.1.x 兼容,还支持其他一些三字母时区 ID(例如PST"、CTT"、AST").但是,它们的使用已被弃用...
For compatibility with JDK 1.1.x,some other three-letter time zone IDs (such as "PST","CTT","AST") are also supported. However,their use is deprecated...
这里说的是其他",但我看不出它在哪里定义了哪些三字母 ID 不被弃用.这些是否记录在任何地方?
GMT 在文档中被提及为后备,因此可以安全地假设它是未弃用的 ID 之一;但是:
- UTC 是否已弃用?您打算改用 Etc/UTC 吗?还是应该使用 GMT?(TimeZone.getTimeZone("UTC").hasSameRules(TimeZone.getTimeZone("GMT") 为真)
CET(中欧时间)是否已弃用?如果不是,您应该使用哪个时区标识符?根据 this demo,只有一个其他标识符产生相同的规则,即 MET(中欧时间).
- Is UTC deprecated? Are you meant to use Etc/UTC instead? Or should you be using GMT? (TimeZone.getTimeZone("UTC").hasSameRules(TimeZone.getTimeZone("GMT") is true)
Is CET (Central European Time) deprecated? If not,what time zone identifier are you supposed to use instead? according to this demo,there is only one other identifier yielding the same rules,which is MET (Middle European Time).
还有另一个时区 ID,ECT,其显示名称与 CET(中欧时间)相同,但规则不同(I认为它们在 1970 年代中期有所不同),其规则与 Europe/Paris 相同.但是,由于它们的规则不同,因此两者不能互换.
因此,我由此得出的结论是,支持的三字母 ID 的最小集合是 GMT 和 CET;但是没有记录似乎很奇怪.有什么想法吗?
我注意到@shmosel 建议的可能重复:是GMT"吗?Java TimeZone 中的缩写,如果是,可以使用它吗?.这部分涵盖了我的问题;但我问的是更笼统的问题支持什么(以及我们如何知道)",而不仅仅是支持 X".
I note the possible duplicate suggested by @shmosel: Is "GMT" an Abbreviation in Java TimeZone and if So is it OK to use it?. That partly covers my question; but I'm asking the more general question "what is supported (and how do we know that)",rather than just "is X supported".