Ubuntu 12.0.4 上的 Rails 应用程序,tzdata 2016j 提取不正确的时区缩写 [英] Rails app on Ubuntu 12.0.4, tzdata 2016j pulling incorrect time zone abbreviations

查看:37
本文介绍了Ubuntu 12.0.4 上的 Rails 应用程序,tzdata 2016j 提取不正确的时区缩写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有其他人在使用 tzdata 2016j 的 Ubuntu 12.0.4 机器上的 Rails 应用程序中看到特定时区缩写的问题.

I'm wondering if anyone else is seeing an issue with specific time zone abbreviations in their Rails apps on Ubuntu 12.0.4 boxes with tzdata 2016j.

对于亚洲/埃里温、亚洲/伊斯坦布尔和亚洲/巴库,我似乎得到了不正确的时区缩写 - Time.now.in_time_zone 将显示带有区域缩写的时间:+04、+03、+04 运行时Ubuntu 12.0.4 上的应用程序,而在我的 Mac (OS X El Capitan) 上,我分别看到 AMT、EET 和 AZT(看起来伊斯坦布尔的时区不正确).

For Asia/Yerevan, Asia/Istanbul, and Asia/Baku I seem to be getting incorrect Time Zone abbreviations - Time.now.in_time_zone will display the time with zone abbreviations: +04, +03, +04 when running the app on Ubuntu 12.0.4, whereas on my Mac (OS X El Capitan), I'm seeing AMT, EET, and AZT respectively (looks like Istanbul is getting incorrect time zone there).

如果您使用的是任何其他版本的 Ubuntu 或 tzdata,我也希望您能深入了解这些区域的时区缩写.我仍在试图找出堆栈的哪一部分导致了问题.

If you're on any other version of Ubuntu or tzdata, I'd also appreciate any insight into what time zone abbreviations you get for these zones. I'm still trying to figure out which part of the stack is causing the issue.

此外,如果有人有解决方法,我也非常感谢您提供任何见解.

Also, if anyone has a workaround, I'd greatly appreciate any insight there as well.

推荐答案

源数据本身已更改.在过去的几个版本中,TZ 维护者一直在删除以前发明的或未经证实的缩写.

The source data itself has been changed. Over the last several releases, the TZ maintainers have been removing abbreviations that were previously invented or otherwise unsubstantiated.

事实上,时区缩写"的概念并不是一个普遍的概念.我们认为世界各地的每个人都在使用它们,但实际上他们没有.当他们这样做时,它们的含义不一定与我们认为的相同,或者是普遍使用的所选缩写.例如,明斯克的一个人可能碰巧使用与莫斯科的人相同的 UTC 偏移量,但莫斯科使用 MSK 是众所周知的.将其应用于明斯克可能会被视为一种侮辱.事实上,TZDB 过去一直使用 MSK 来表示明斯克时间",直到最近的一组更改开始.

The fact of the matter is that the idea of a "time zone abbreviation" is not a universal concept. We'd like to think that everyone around the world uses them, but really they don't. And when they do, they do not necessarily mean the same things as we think they do, or are the chosen abbreviations used universally. For example, A person in Minsk might happen to use the same UTC offset as a person in Moscow, but Moscow's use of MSK is well-known. Applying it to Minsk could be taken as an insult. Indeed, the TZDB used to use MSK for "Minsk Time", until this recent set of changes started.

当您考虑其他语言中的缩写时,情况会变得更加复杂.

It gets even more complicated when you think about abbreviations in other langugages.

如果您有文件证明居住在相关地点的人实际上使用了缩写(即,巴库的人实际上说AZT"),请在讨论邮件列表中提交您的发现 IANA.

If you have documentation to show that an abbreviation is actually used by those who live in the place in question (i.e., do people in Baku actually say "AZT"), then please present your findings on the discussion mailing list at IANA.

如果你只是想找回你以前拥有的东西 - 你必须列出你自己发明的"缩写并参考它.TZDB 很清楚它不再想成为错误信息的来源.

If you're just trying to get back what you had before - you'll have to make a list of your own "invented" abbreviations and refer to that. The TZDB is clear that it no longer wants to be the source of misinformation.

恕我直言,更好的选择是完全避免使用时区缩写.

The better option, IMHO, is just to avoid using time zone abbreviations at all.

这篇关于Ubuntu 12.0.4 上的 Rails 应用程序,tzdata 2016j 提取不正确的时区缩写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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