I was trying to get the computer's time zone programmatically. In my case it could be Eastern Daylight Time, or Eastern Standard Time, and it varies with the time of year.
In Windows, you can ask at the Command Prompt
> tzutil /g
Eastern Standard Time
>
So from inside ObjectScript, I can call
set x=$ZF(-1,"tzutil /g") to run the code.
However, x is set to the status code (like 0), not the correct output.
I can direct the output to a file
set x=$ZF(-1,"tzutil /g > timezone.txt")
and then open the file and read it, and that works.
But is there a way to just grab the output and return that as the result?
2) I tried this with $ZF(-100 since the documentation says that $ZF(-1 is deprecated in favor of $ZF(-100, but I got a <NOTOPEN> error no matter how I set the flags. How should this be called?
3) Is there some simpler way to get the time zone from within Cache' itself?
Thanks!
Michael Reach
[Cache for Windows (x86-64) 2018.1.4 (Build 505_1_20258U) Thu Sep 10 2020 10:22:2
2 EDT]