检测用户的时区 [英] detecting user's timezone
问题描述
我想知道当他/她访问时是否可以检测到用户(浏览器的)时区
我的php文件?我看到人们建议使用javascript
来收集这些信息。但是我想知道是否有可能这样做没有javascript头痛的话。
谢谢,
<?php
//(1)在这里我以某种方式得到他/她的时区
//(2)这里将他/她的登录时间戳填入数据库----
显然,这个时间戳应转换为统一时间
区域。
?>
Hi,
I wonder if it''s possible to detect a user (the browser''s) timezone
when he/she access my php file? I saw ppl suggesting using javascript
to collect that information. But I wonder if it''s possible to do it
without the headache of javascript.
Thanks,
<?php
// (1) here I somehow get his/her timezone
// (2) here fill his/her login timestamp into database----
apparently, this timestamp should be converted to a unified time
zone.
?>
推荐答案
newbie写道:
newbie wrote:
我不知道是不是当他/她访问我的php文件时,可以检测到用户(浏览器的)时区
?我看到人们建议使用javascript
来收集这些信息。但是我想知道是否可以这样做
而不用头痛的javascript。
谢谢,
<?php
//(1)在这里我以某种方式得到他/她的时区
//(2)这里填写他/她的登录信息时间戳到数据库----
显然,这个时间戳应转换为统一时间
区域。
?>
Hi,
I wonder if it''s possible to detect a user (the browser''s) timezone
when he/she access my php file? I saw ppl suggesting using javascript
to collect that information. But I wonder if it''s possible to do it
without the headache of javascript.
Thanks,
<?php
// (1) here I somehow get his/her timezone
// (2) here fill his/her login timestamp into database----
apparently, this timestamp should be converted to a unified time
zone.
?>
不。你需要一些可以在客户端系统上运行的东西来检查
时区设置 - 即javascript。
-
==================
删除x来自我的电子邮件地址
Jerry Stuckle
JDS计算机培训公司
js ******* @ attglobal.net
==================
Nope. You need something which will run on the client''s system to check
the timezone setting - i.e. javascript.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
7月6日晚上7:25,newbie< mitbb ... @ yahoo.comwrote:
On Jul 6, 7:25 pm, newbie <mitbb...@yahoo.comwrote:
我想知道当他/她访问我的php文件时是否有可能检测到用户(浏览器的)时区
?我看到人们建议使用javascript
来收集这些信息。但是我想知道是否有可能这样做没有javascript令人头疼的话。
谢谢,
<?php
//(1)在这里我以某种方式得到他/她的时区
//(2)这里填写他/她的登录信息时间戳到数据库----
显然,这个时间戳应转换为统一时间
区域。
?>
Hi,
I wonder if it''s possible to detect a user (the browser''s) timezone
when he/she access my php file? I saw ppl suggesting using javascript
to collect that information. But I wonder if it''s possible to do it
without the headache of javascript.
Thanks,
<?php
// (1) here I somehow get his/her timezone
// (2) here fill his/her login timestamp into database----
apparently, this timestamp should be converted to a unified time
zone.
?>
如果您将时间转换为统一时区为什么你关心
他们在哪个时区?为什么要记录数据库中客户端的时间?
If you''re converting the time to a "unified time zone" why do you care
what timezone they''re in? Why would you be recording the time from
the client in your database?
ZeldorBlat kirjoitti:
ZeldorBlat kirjoitti:
如果您将时间转换为统一时区,为什么你关心
他们在哪个时区?为什么要记录数据库中客户端的时间?
?
If you''re converting the time to a "unified time zone" why do you care
what timezone they''re in? Why would you be recording the time from
the client in your database?
不记录,只显示。当然记录全球时间
时间戳,比如GMT,但人们仍然希望看到时间显示在他们当地时区的时间,所以OP想要知道如何获得它然后
将GMT转换为当地时间,仅用于_displaying_ it到用户。这是常见的
本地化实践。维基百科就是这样做的。
-
Ra ** *******@gmail.com
" Wikipedia on v?h?n niinq internetin raamattu,kukaan ei pohjimmiltaan
usko siihen ja kukaan ei并列? MIK?坑?? paikkansa"。 - z00ze
Not record, just show. Naturally it makes sense to record a global time
timestamp, like GMT, but people still like to see a time displayed in
their local timezone, so the OP wants to know how to get it and then
convert GMT to local time, just for _displaying_ it to user. It''s common
localization practise. Wikipedia for one does this.
--
Ra*********@gmail.com
"Wikipedia on v?h?n niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tied? mik? pit?? paikkansa." -- z00ze
这篇关于检测用户的时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!