1

我的 Rails 应用程序通过使用TZInfo::Timezone.all_identifiers.

我能够:00毫无问题地调出具有 GMT 偏移量的时区:

irb(main):008:0> TZInfo::Timezone.get("Etc/GMT+1")
=> #<TZInfo::DataTimezone: Etc/GMT+1>

但是,当尝试Etc/使用:30偏移量提取时区时,我收到以下运行时异常:

irb(main):012:0> TZInfo::Timezone.get("Etc/GMT+5:30")
Traceback (most recent call last):
        1: from (irb):12
TZInfo::InvalidTimezoneIdentifier (Invalid identifier)

我正在专门寻找Indian/Delhior Etc/GMT+5:30

如何将自定义时区名称/偏移量添加到tzinfogem 中的源列表中?

4

0 回答 0