如何自动检测用户的时区? [英] How to automatically detect user's timezone?

查看:127
本文介绍了如何自动检测用户的时区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个Web应用程序,如果用户注册,我们将在其中显示创建的日期.

hi i am creating a web application , where if a user register we will show the created date.

为此,我们在sql表中使用当前时间戳.其中显示服务器时间.但是我们不知道如何根据用户时区转换时间.

For that we are using Current time stamp in my sql table.Which shows server Time.But we don't know how to convert Time according to user time zone.

因为我们不是获取用户的国家/地区.

有什么可以帮助我解决此问题

Can any on help me to fix it

先谢谢您了:)

推荐答案

使用JavaScript解决方案

http://www .onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/

演示应在选择框中显示您的时区.

Demo should show your timezone in select box.

http://onlineaspect.com/examples/timezone/index.html (无效链接)

http://onlineaspect.com/examples/timezone/index.html (Dead link)

这篇关于如何自动检测用户的时区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆