How to get the timezone from user's computer/laptopWhich will be the best or simpler way to get the current UTC time (including timezone) of the user running JMP?
Re: How to get the timezone from user's computer/laptoprequest = New HTTP Request(
URL("google.com"),
Method("GET"),
);
request << Send("blob");
headers = request << Get Response Headers();
utc = headers["date"];
tz = round((today() - utc)/inhours(1));
show(tz);
This should be the complete script.
Re: How to get the timezone from user's computer/laptopThanks Bryan, could you please edit your previous post with the improved code? I am accepting this as solution.
Re: How to get the timezone from user's computer/laptopThis might be a little better, so it won't miss the boundaries
utc = headers[ "date" ];
tz = Date Difference (utc, today (), "hour" );
show (tz);
Re: How to get the timezone from user's computer/laptopBTW... you can use any url. Routers/switches use UTC time.
Re: How to get the timezone from user's computer/laptopThis is UTC Time:
request = New HTTP Request(
URL("google.com"),
Method("GET")
);
request << Send;
headers = request << Get Response Headers();
show(headers["date"]);
headers["date"] is a JSL Date object in UTC
so the timezone offset would be:
utc = headers["date"];
Hour(today()) - Hour(utc);
Re: How to get the timezone from user's computer/laptopHi,
There is a post on the community here that might be able to help: https://community.jmp.com/t5/Uncharted/UTC-Time-Zone/ba-p/28942.