cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
BabyDoragon
Level II

How can I obtain the current country/region of the computer

It is necessary to record the user's region ( likes US, Canada, Europe, etc. ). May I ask what methods are available to obtain the current country/region of the computer? Is it possible to get it using Get Environment Variable()? I couldn't find which variables this function can retrieve.

 

2 REPLIES 2
txnelson
Super User

Re: How can I obtain the current country/region of the computer

I believe you have to get it from the Windows Registry. 

powershellCmd = "powershell -command \!"(Get-ItemProperty -Path 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation' -Name 'TimeZoneKeyName').TimeZoneKeyName\!"";

timezone = RunProgram(
  executable("cmd.exe"),
  options({"/C", powershellCmd}),
  readFunction("Text")
);

Show(timezone);
Jim
BabyDoragon
Level II

Re: How can I obtain the current country/region of the computer

I would like to confirm whether the returned timezone information differentiates between specific regions.
For example, both Japan and Korea are in the +9 timezone—will it return "Tokyo Standard Time" and "Seoul Standard Time" separately?
Or will it show the same name for both, such as "Tokyo Standard Time," to indicate the timezone?

Recommended Articles