Subject:use javascript to get client time zone offset Author:gary comstock Date:14 Feb 2007 03:19 PM
We have a web service that returns an MS Exchange servers free/busy schedule for a specified user. The problem is that while applying the xslt stylesheeet I need to know the browser clients time zone to know what postion() to start. I discovered the java date object but apparantly this is the server date. Everything would work fine if I could just execute this piece of javascript and use the output as $gmtoffset:
function GetClientUTC()
{
var now = new Date();
var offset = (now.getTimezoneOffset() / 60)*-1;
return offset;
}
Can someone give me some direction on achieving this?
Subject:use javascript to get client time zone offset Author:gary comstock Date:14 Feb 2007 05:06 PM
My example above uses java and works quite well except I believe the java date object is not the invoked client side as javascript, its done server side as java.
When I change the time zone on my development machine to EST and have a simple html form using this javascript function:
function GetClientUTC()
{
var now = new Date();
var offset = (now.getTimezoneOffset() / 60)*-1;
return offset;
}
The value is as expected -5.
When I run the above XSLT example no matter what time zone I change my development machine always shows -6 which is CST and the time zone I reside along with all of our corporate servers so somehow the date object is being picked up somewhere other than my development machine.
Subject:use javascript to get client time zone offset Author:Tony Lavinio Date:15 Feb 2007 09:34 AM
Since you're into browser and Javascript territory, and neither is
part of Stylus Studio, and this is a Stylus Studio support forum,
you'll probably have to look elsewhere to go further.