On Mon, 10 Mar 2008 20:01:59 -0500, William H. Blair wrote:
>>
>> The service corresponding to time() is TIME STCK[E],,ZONE=GMT
>
>Except for the difference in epoch and radix, the UNIX time()
>function is conceptually equivalent to z/OS "TIME STCK[E],addr"
>or "TIME BIN,addr,ZONE=GMT" or "TIME DEC,addr,ZONE=GMT".
>
Here we agree.
>It would have been nice if z/OS had implemented the following
>function:
>
> TIME STCK[E],addr,ZONE=LT
>
I would prefer that ZONE be an argument to STCKCONV so any user
anywhere could convert a timestamp, possibly recorded elsewhere,
to local time. Even better, ZONE should support values indicating
specific, not necessarily local, time zones.
>> The service corresponding to gmtime() is STCKCONV
>
>Nope. STCKCONV is just a formatting conversion service. It does
>not "return" anything about the current time or date on the
>system on which it is executed. ...
>
No. RTFM:
man gmtime
...
struct tm *
gmtime(const time_t *clock);
...
The function gmtime() similarly converts the time value, but
without any time zone adjustment, and returns a pointer to a
tm structure ...
gmtime() is just a formatting conversion service. It does not
"return" anytthing about the current time or date on the system
on which it is executed.
In what way does this not correspond to STCKCONV?
> ... In z/OS what corresponds to
>the UNIX gmtime() function is (at best) "TIME BIN,addr,ZONE=GMT"
>or "TIME DEC,addr,ZONE=GMT".
>
>> I know of no service corresponding to localtime().
>
>In z/OS what corresponds to the UNIX localtime() function is
>(at best) "TIME BIN,addr,ZONE=LT" or "TIME DEC,addr,ZONE=LT".
>
No. RTFM:
struct tm *
localtime(const time_t *clock);
The function localtime() converts the time value pointed at by clock, and
returns a pointer to a ``struct tm'' (described below) which contains the
broken-out time information for the value after adjusting for the current
time zone (and any other factors such as Daylight Saving Time).
Again, localtime() is just a formatting conversion service ...
>There is no built-in z/OS service I know of that will return a
>TOD clock-format (STCK or STCKE) value that has been corrected
>to represent the local time.
As above, such corrections would more usefully be performed by
STCKCONV, so archival timestamps could uniformly be uncorrected
TOD clock values.
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html