cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • See how to use the JMP Marketplace – Free tools to expand JMP capabilities. Register. July 10, 2 pm 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