× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Adam,

Adam Glauser wrote:
The result of CEEUTCO (get system offset from UTC) is retrieved only once per activation group. It is stored in a static variable and reused whenever the procedure is called.

Correct. That's just the way I wrote the code. You're welcome to change it! Here's what it looks like:

D offset s 10I 0 static inz(-1)

if (offset = -1);
CEEUTCO(Hours: Mins: Secs: *omit);
offset = secs;
endif;

So "offset" is initialized to -1. When it's set to -1, it calls the API to retrieve the current UTC offset from the system's time zone. Then, because offset is declared as 'static' it keeps it's value between calls, so the API is not called again.

that's just to make the code more efficient. On my system, this routine may be executed many thousands of times. It doesn't make sense to call the API every single time, since the time zone isn't likely to change.

The only time the UTC offset changes on my system is when daylight savings time starts/ends... and I don't have production apps running at that time.



Does this mean that the API retrieves the system time from a
job-specific setting? If the system's timezone is changed, does this
mean that jobs in progress are not effected by the change?

What? No, it's not job-specific. It's ultimately coming from the sysval for time zone and/or UTC offset.

You're right that jobs in progress would not be affected by the change -- but again, that's just because of the IF statement in the code. If you don't like it, it should be easy to remove that "if offset = -1" from the code...


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.