问题标签 [tzinfo]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ruby - 通过 Ruby/tzinfo 在给定日期获取时区的 UTC 偏移量?
tzinfo
对于任何了解API的人来说,这可能都是微不足道的:
给定一个Timezone
来自 的对象tzinfo
,我如何获得给定时间点的 UTC 偏移量(在时区的本地时间或 UTC 中给出)?
mysql - mysql_tzinfo_to_sql ORDER BY 错误
我需要mysql_tzinfo_to_sql
为一个项目运行该实用程序,并且每当我尝试运行第一个命令时:
我收到以下错误:
我的理解是因为ORDER BY
没有处理它不会进一步更新时区,虽然我从未接触过这个基础,但我不确定如何最好地解决这个问题。
同样在尝试运行时:
我收到以下错误:
编辑:我在 macOS Sierra (10.12.6) 上运行,因此我试图做所有这些:https ://docs.djangoproject.com/en/1.10/ref/databases/#mysql-time-zone -定义
python - 如何在 Python 中使用 datetime.tzinfo?
我不知道如何使用datetime.tzinfo
模块。我必须将日期时间数据从 UTC 转换为本地时区,如果我检索“+2”(这意味着 gmt+2),如何将其转换为 tzinfo 对象?
此外,是否可以从 UTC 转换为本地时区并自动应用夏令时?如何设置仅在 dst 期间自动减去一小时?
ruby-on-rails - 耙分贝:迁移错误。要求 tzinfo-1.2.1
我是 Rails 新手,所以请随时提出任何可能有帮助的建议
Gemfile如下
当我sudo rake db:migrate
在终端上运行时[出于某种原因,每次运行 rake 命令时我都需要 sudo],我得到
在任何源中找不到 tzinfo-1.2.1 运行
bundle install
以安装缺少的 gem。
我尝试删除 Gemfile.lock 并再次运行 bundle install ,但没有帮助。我用谷歌搜索并没有找到任何帮助。
当我跑bundle info tzinfo
的时候,它确实给了我一个位置
我在这个问题上尝试了所有建议的东西,但没有帮助
Ubuntu 16.04
python - Python: converting date string to UTC
I am parsing a 3rd party website HTML with dates and times which are always in UK time format, however they don't have any timezone info in the source. Converting the string to an object is easy enough using datetime.strptime(), but how do I add timezone info?
Ultimately, I need to convert these strings to a datetime object in UTC format. The code will always run on a PC which is timezone aware, i.e. datetime.now() will return UK time.
Is there a nicer way to do this?
ruby-on-rails - 将自定义时区添加到 `TZInfo::Timezone`
我的 Rails 应用程序通过使用TZInfo::Timezone.all_identifiers
.
我能够:00
毫无问题地调出具有 GMT 偏移量的时区:
但是,当尝试Etc/
使用:30
偏移量提取时区时,我收到以下运行时异常:
我正在专门寻找Indian/Delhi
or Etc/GMT+5:30
。
如何将自定义时区名称/偏移量添加到tzinfo
gem 中的源列表中?
ruby - 无法从 nil 确定时区(ArgumentError)
我想在 Windows 机器上使用 Smashing(一个基于 sinitra 的仪表板制作工具)。使用启动默认项目时smashing start
出现以下错误:
上网查了一下,发现这个问题可能是windows的问题,我尝试gem 'tzinfo-data'
在我的gemfile中添加,但并没有改变任何东西。你知道我怎么能解决这个问题吗?
ruby-on-rails - tzinfo-data + Rails 报告爱尔兰的时区偏移量错误
在尝试检索爱尔兰的时区时,我看到了一些奇怪的结果。
在 Mac OS X 上(没有 tzinfo-data)
然后在 Ubuntu 上我得到:
然后,在带有“tzinfo-data”的 Mac OS X 上,我得到:
爱尔兰是 GMT+0(偏移量不包括 DST,伦敦目前报告 +0 和马德里 +1,但正如我写的那样,它们都使用 +1 和 +2(BST 和 CEST))
为什么我在 Ubuntu 或 tzinfo-data 上获得 GMT+1?
编辑:
好的,我有一些没有使用tzinfo-data
1.2018.4的 rails 的结果
使用tzinfo-data
1.2018.5
ruby - 为什么 Bundler 找不到兼容的版本,但我可以?
我正在bundle upgrade
寻找一些宝石,并遇到一些我觉得奇怪的错误:
tzinfo 1.1 不会满足这一点吗?不>= 1.0.0
只是一个子集tzinfo (~> 1.1)
吗?
为什么 mongo 2.4.1 不能满足这些?
python - 如何实现“tzinfo”以将当前 GMT 偏移到 EST(GMT -4:00)?
我的函数将 UTC 日期时间字符串作为参数,将其转换为日期时间对象,然后我需要将其偏移到 EST(GMT -4:00)。例如,将“<em>2019-07-01T00:00:00Z”传递给函数应返回“<em>06/30/2019 08:00:00”。
以下是我如何实现“ tzinfo ”的子类及其标准方法。
最后一个打印语句的预期输出是2019-06-30 20:00:00-04:00但程序返回2019-06-30 14:30:00-04:00。仅当我将 'utcoffset' 函数的 'timedelta' 中的值设置为 时,它才会显示预期结果timedelta(hours=1, minutes=30)
。
请注意,我只想使用“日期时间”库来实现这一点。