cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

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