I am using this https://github.com/sonnyt/downCount for my countdown and here is the script
我正在使用这个https://github.com/sonnyt/downCount进行倒计时,这是脚本
<script type="text/javascript">
$(document).ready(function() {
$('.countdown').downCount({
date: '12/25/2015 00:00:00',
});
});
</script>
I am launching the website tonight and I need the countdown to change for U.S visitors. Is there any way I can change the setting to U.S Location from U.K?
我今晚要推出这个网站,我需要倒计时才能改变美国访客。有什么方法可以从英国改变设置到美国的位置吗?
There is a offset: -5 setting but I don't know how to change it for locations.
有一个偏移:-5设置,但我不知道如何更改位置。
Thanks
1 个解决方案
#1
0
$(document).ready(function() {
var strDateTime = "12/25/2015 00:00:00 GMT -7";
var myDate = new Date(strDateTime);
var LocalDate = myDate.toUTCString();
alert(LocalDate);
$('.countdown').downCount({
date: LocalDate,
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Hello you can convert your time based on the following code
您好,您可以根据以下代码转换您的时间
If the user run the page FROM us then it will show US start time and if he run from UK then user can see UK local time.
如果用户运行页面FROM us,那么它将显示美国的开始时间,如果他从英国运行,那么用户可以看到英国当地时间。
#1
0
$(document).ready(function() {
var strDateTime = "12/25/2015 00:00:00 GMT -7";
var myDate = new Date(strDateTime);
var LocalDate = myDate.toUTCString();
alert(LocalDate);
$('.countdown').downCount({
date: LocalDate,
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Hello you can convert your time based on the following code
您好,您可以根据以下代码转换您的时间
If the user run the page FROM us then it will show US start time and if he run from UK then user can see UK local time.
如果用户运行页面FROM us,那么它将显示美国的开始时间,如果他从英国运行,那么用户可以看到英国当地时间。