|
Convert Time of Day (TOD) Clock values from the STCK and
STCKE instructions to date/time and UNIX date/time values.
Convert From STCK
| TOD:
x"
" |
| UTC Date and Time (Date + HH:MM:SS):
|
| UNIX Date/Time:
|
Notes About TOD Clock Values
z/Series mainframes store the Time of Day (TOD) Clock as
a 104 bit register holding a value that represents the time
elapsed since 00:00:00 on Jan 1, 1900. Bit 51 of this register
is incremented every microsecond.
You can get this information using one of two instructions:
1. STCK (Store Clock) - this is the older style instruction.
You get a doubleword which is the first 64 bits of the TOD
clock value.
2. STCKE (STCK Extended) - You get four words that look like::

So you get the whole TOD clock, an extra byte of zeroes at
the beginning, and a programmable section used by z/OS at
the end.
The problem with a 104 bit TOD clock is that it will run
out of bits on 07-Sep-2042, and the time will reset to 01-Jan-1900.
To solve this, later Mainframe models will use a larger TOD
clock register and the high order byte from the STCKE instruction
will be used.
To get a correct UTC value, you need to add 'leap seconds'
to the TOD clock value. This number of leap seconds for the
current time is stored in the CVT field CVTLSO.
Of course this assumes that the TOD Clock is set to UTC time,
and an offset to local time is specified in the CLOCKxx parmlib
member.
An interesting fact: STCK will ALWAYS produce a unique number
throughout a CPC. The STCKE instruction will ALWAYS produce
a unique number throughout a sysplex.
|