cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

getTimezoneOffset() returns 0

JO_9930585
12-Amethyst

getTimezoneOffset() returns 0

I am trying to write a service that returns the local time offset from UTC. I simply create a new Date() object and run the getTimezoneOffset() on this object. I verified that the date object is indeed my local time, but the getTimezoneOffset() is returning 0. How can I get the offset from UTC?

 

 

var date = new Date(); // this is returning my local date/time
var localOffset = date.getTimezoneOffset(); //this is returning 0

 

ACCEPTED SOLUTION

Accepted Solutions

The solution is to run this in an expression. I was running this in a service which will not get local browser time even though it converts my queries to local time.

View solution in original post

1 REPLY 1

The solution is to run this in an expression. I was running this in a service which will not get local browser time even though it converts my queries to local time.

Announcements


Top Tags