如何使用actionscript 3获得IST(印度标准时间)时间

时间:2013-11-07 23:32:26

标签: actionscript-3 gmt

我需要访问ISTusing as3。我不需要系统时间,因为我想要精确的IST。我已经尝试了getTimezoneOffset(),但是它显示了不同于当前系统时间的I / W和GMT的差异。在我的情况下,我严格需要来自互联网的IST使用系统时间。 你可以帮帮我吗?非常感谢你。

1 个答案:

答案 0 :(得分:0)

可能会帮助你找到你想要的东西。

<html>
<head>
<title>time test</title>
<script>


function getTime(zone, success) {
var url = 'http://json-time.appspot.com/time.json?tz=' + zone,
    ud = 'json' + (+new Date());
window[ud]= function(o){
    success && success(new Date(o.datetime));
};
document.getElementsByTagName('head')[0].appendChild((function(){
    var s = document.createElement('script');
    s.type = 'text/javascript';
    s.src = url + '&callback=' + ud;
    return s;
})());
}

getTime('GMT', function(time){
// This is where you do whatever you want with the time:
alert(time);
document.getElementById("time").innerHTML=time;
});
</script>
</head>
<body>
<h1 id="time"></h1>
</body>
</html>