Tag: 时区

获取用户时区

可能重复: 我怎样才能确定一个networking用户的时区? 哪种做法最好? PHP或JavaScript.Can有人提供了一些片段? 谢谢。

如何检测用户的时区?

我需要知道当前我的用户在什么时区根据他们的IP或http头。 我在这个问题上得到了很多答案,但我无法理解这些答案。 有人说使用-new Date().getTimezoneOffset()/60 ( 从这里 )。 但这是什么意思? 我有一个date_default_timezone_set("Asia/Calcutta"); 在我的(index.php)页面的根。 所以为此,我必须dynamic获取时区并将其设置为Asia/Calcutta 。

“date():依靠系统的时区设置是不安全的…”

当我要求在服务器上将PHP版本从5.2.17更新到PHP 5.3.21时,我得到了这个错误。 <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: date(): 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 […]

从经纬度查找时区

是否有任何可以从经纬度转换为时区的图书馆(或更好的networking服务)?

parsingdate时间与PST / CEST / UTC /等forms的时区

我试图parsing国际date时间string类似于: 24-okt-08 21:09:06 CEST 到目前为止,我有这样的东西: CultureInfo culture = CultureInfo.CreateSpecificCulture("nl-BE"); DateTime dt = DateTime.ParseExact("24-okt-08 21:09:06 CEST", "dd-MMM-yy HH:mm:ss …", culture); 问题是我应该用什么格式string中的'…'? 查看自定义date和时间格式string MSDN页似乎没有列出用于parsingPST / CEST / GMT / UTCforms的时区的格式string。

时区转换在PHP中

任何人都可以提出一个简单的方法来转换date和时间在不同的时区在PHP?

如何在不使用string表示的情况下使用设置的时区创buildJavaScript Date对象

我有一个网页,有三个日历,月份和年份的下拉菜单。 如果我使用带数字的JavaScript Date构造函数,那么我得到当前时区的Date对象: new Date(xiYear, xiMonth, xiDate) 给出正确的date,但由于夏令时,它认为date是GMT + 01:00。 这里的问题是,然后我给这个date一个Ajax方法,当date是在服务器上反序列化它已被转换为GMT,所以失去了一个小时,这一天移回一天。 现在我可以将日,月,年分别传递给Ajax方法,但似乎应该有更好的方法。 被接受的答案指出了我正确的方向,但是仅仅使用setUTCHours本身就改变了: Apr 5th 00:00 GMT+01:00 至 Apr 4th 23:00 GMT+01:00 然后,我也必须设置UTCdate,月份和年份结束 Apr 5th 01:00 GMT+01:00 这是我想要的

将UTCdate时间转换为本地date时间

从服务器,我得到这种格式的date时间variables: 6/29/2011 4:52:48 PM ,它在UTC时间。 我想使用JavaScript将其转换为当前用户的浏览器时间。 如何使用JavaScript或jQuery做到这一点?

查找date时间之间是否经过了24小时 – Python

我有以下的方法: # last_updated is a datetime() object, representing the last time this program ran def time_diff(last_updated): day_period = last_updated.replace(day=last_updated.day+1, hour=1, minute=0, second=0, microsecond=0) delta_time = day_period – last_updated hours = delta_time.seconds // 3600 # make sure a period of 24hrs have passed before shuffling if hours >= 24: print "hello" else: print "do nothing" 我想知道last_updated是否已经过了24小时,我怎样才能在Python做到这一点?

我如何设置MySQL的时区?

在一台服务器上,当我运行: mysql> select now(); +———————+ | now() | +———————+ | 2009-05-30 16:54:29 | +———————+ 1 row in set (0.00 sec) 在其他服务器上: mysql> select now(); +———————+ | now() | +———————+ | 2009-05-30 20:01:43 | +———————+ 1 row in set (0.00 sec)