如何使用JSP检测客户端时区? [英] How to detect Client timezone using JSP?

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

问题描述

你好所有专家



有没有办法检测客户时区?

我正面临时区问题。我需要把UTC兑换成其他时区。







预付款

Sush

Hello All experts

Is there any way to detect client timezone?.
I am facing the problem of timezone.I Need to convert UTC to other time zone.



Thanks in Advance
Sush

推荐答案

试试这个



Try this

function getTimeZoneId(){
   var timezone=String(new Date());
   return timezone.substring(timezone.lastIndexOf('(')+1).replace(')','').trim();
}


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

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