Tag: 时区

在Excel中parsingISO8601date/时间(包括TimeZone)

我需要在Excel / VBA中将包含时区(来自外部源)的ISO8601date/时间格式parsing为正常的Exceldate。 据我所知,Excel XP(这就是我们正在使用的)没有内置的例程,所以我想我正在看一个自定义的VBA函数的parsing。 ISO8601date时间看起来像这样一个: 2011-01-01 2011-01-01T12:00:00Z 2011-01-01T12:00:00+05:00 2011-01-01T12:00:00-05:00 2011-01-01T12:00:00.05381+05:00

Symfony2和date_default_timezone_get() – 依靠系统的时区设置是不安全的

我有一个Symfony2项目。 我今天更新了我的PHP到5.5.7,从那以后,我得到了 Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for […]

Python的time.time()返回本地或UTC时间戳吗?

Python时间模块中的time.time()是否返回系统时间或UTC中的时间?

如何在Nodejs中使用时区偏移?

我需要下一个stream程: var a = new Date(1337324400000, 'Europe/Amsterdam'); //+2h console.log(a); // for example 12:00 Mon … a.setTimeZone('Europe/Kiev'); //+3h console.log(a); // 13:00 Mon … nodejs utils api中有这种可能吗?

Moment.js:在特定时区格式化date

我正在使用Moment.js在我的web应用程序中parsing和格式化date。 作为JSON对象的一部分,我的后端服务器发送的date是从UTC纪元(Unix偏移量)开始的毫秒数。 在特定的时区parsingdate很简单 – 在parsing之前,只需将RFC 822时区标识符附加到string的末尾即可: // response varies according to your timezone moment('3/11/2012 13:00').utc().format("MM/DD HH:mm") // problem solved, always "03/11 17:00" moment('3/11/2012 13:00 -0400').utc().format("MM/DD HH:mm") 但是,如何在特定的时区格式化date? 无论浏览器的当前时间如何,我都希望获得一致的结果,但我不希望以UTC显示date。

PHP将datetime转换为UTC

我需要一个简单的方法来将date时间戳转换为UTC(无论服务器在什么时区)HOPEFULLY没有使用任何库。

MySQL JDBC驱动程序5.1.33 – 时区问题

一些背景: 我有一个运行在Tomcat 7上的Java 1.6 webapp。数据库是MySQL 5.5。 以前,我使用Mysql JDBC驱动程序5.1.23连接到数据库。 一切正常。 我最近升级到了Mysql JDBC驱动程序5.1.33。 升级之后,Tomcat会在启动应用程序时抛出这个错误。 WARNING: Unexpected exception resolving reference java.sql.SQLException: The server timezone value 'UTC' is unrecognized or represents more than one timezone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc timezone value if you want […]

MySQL的时区更改?

我如何将当前UTC时区更改为GMT + 1,什么是正确的行,我只是在phpMyAdmin SQL执行中input它? 我的主机只是给了我这个链接http://dev.mysql.com/doc/refman/5.1/en/time-zone-support.html并走了,所以我有点失去了感谢

Python时间到了,第二部分:时区

继上一个问题之后, Python的时间到了 ,我现在遇到了关于时区的问题,结果并不总是“+0200”。 所以当strptime试图parsing它时,就会抛出exception。 我想只是用[:-6]或者其他什么来砍掉+0200,但是有没有一种真正的方法可以用strptime来实现呢? 如果它很重要,我正在使用Python 2.5.2。 >>> from datetime import datetime >>> fmt = "%a, %d %b %Y %H:%M:%S +0200" >>> datetime.strptime("Tue, 22 Jul 2008 08:17:41 +0200", fmt) datetime.datetime(2008, 7, 22, 8, 17, 41) >>> datetime.strptime("Tue, 22 Jul 2008 08:17:41 +0300", fmt) Traceback (most recent call last): File "<stdin>", line 1, in <module> File […]

在PHP中将时间和date从一个时区转换为另一个时区

基本上我需要的是一个脚本,当提供一个时间和一个时区可以在另一个时区返回时间。 我的主要问题是: 在哪里得到从格林尼治标准时间偏移 – 是否有一个公共数据库可用于此? 如何也考虑到夏令时(DST)的差异。 如何很好地将其包装在一个PHP类中 – 还是有这样一个类已经可用?