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

倾然丶 夕夏残阳落幕 提交于 2021-01-28 05:28:44

问题


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:


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.



来源:https://stackoverflow.com/questions/46171737/convert-java-timestamp-in-tod-format-time-of-day-on-z-os

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!