Convert Java Timestamp in TOD Format (Time of Day) on z/os

882 Views Asked by At

As the Search Method "readSearch" of the ZLogstream class needs the Timestamp in TOD format, I've to convert the JAVA Timestamp in TOD (Time of Date) format.

I couldn't find any class (wrapper), which does that for me. Only the getTodClock of the ZUtil class give me the current TOD (Time of Date),but I couldn't convert any timestamp in the right format.

Could anybody help me?

Thanks in advance.

1

There are 1 best solutions below

3
On

This works for me in a Rexx procedure:

Tod = (epoc*4096000000)+9048018124800000000

TOD (Time-of-Day in S360, S370, S390 & z/Arch IBM's archs) is a 64bit counter whose Bit position 31 is incremented every 1.048576 seconds, starting at 1900-01-01.

So, 2**32/1.048576 = 4096000000 = 1 sec.

9048... is the difference between 1900-01-01 and epoch 1970-01-01 in TOD units.