Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HP tandem Cobol85 convert date-time to timestamp

423 views
Skip to first unread message

Memmedaga Memmedov

unread,
Jul 8, 2021, 9:26:34 AM7/8/21
to
Hi,
I can create timestamp value in realtime using "ENTER TAL "JULIANTIMESTAMP" GIVING S-TIMESTAMP"
For example, timestamp 212492402667471197 date 20210707 time10242747
Now, I want to create timestamp value using input date and time.
I mean date 20190101 time 23595900, I want to find what was timestamp value for previous dates?

Bill Honaker

unread,
Jul 8, 2021, 12:51:50 PM7/8/21
to
Go online to the HPE Manuals website (https://www.hpe.com/info/nonstop-docs), and choose the proper (NonStop L-Series or NonStop J-Series, for example).

Search for and download 2 manuals, 'Guardian Programmer's Guide' and 'Guardian Procedure Calls Reference Manual'.

Find the chapter in the Programmer's Guide called 'Managing Time', it will discuss a lot of these concepts.

Note that if your system is located in a zone that observes Daylight Savings, or Summer, time, historical timestamps may have some anamolies.

The JULIANTIMESTAMP you retrieved represents a GMT time, not a Local time. So as you determine the JTS for a time in the past,
keep in mind you will have to do some conversions.

The section of that chapter you need is 'Converting Between a Julian Timestamp and a Gregorian Date and Time'.
In particular, the example of COMPUTETIMESTAMP and CONVERTTIMESTAMP.

If you need to deal with the time in other time zones, it gets a lot more complex. I've used the C Runtime library's time functions to help that,but you will
find there's a lot of trial and error involved. Temporal mechanics, even on just our one world, is NOT for the faint of heart.

Good luck,
Bill


Memmedaga Memmedov

unread,
Jul 10, 2021, 3:19:21 PM7/10/21
to
@Bill, thanks for your support. As you said, I wrote small C code using COMPUTETIMESTAMP command for converting Gregorian to Julian Timestamp. Then called c function from cobol program. It was 3 hours between converting timestamps, no problem I calculated it. Solved.

wbreidbach

unread,
Aug 26, 2021, 9:31:43 AM8/26/21
to
Memmedaga Memmedov schrieb am Samstag, 10. Juli 2021 um 21:19:21 UTC+2:
> @Bill, thanks for your support. As you said, I wrote small C code using COMPUTETIMESTAMP command for converting Gregorian to Julian Timestamp. Then called c function from cobol program. It was 3 hours between converting timestamps, no problem I calculated it. Solved.
You should be aware that JULIANTIMESTAMP always returns a GMT-timestamp. You need CONVERTTIMESTAMP to convert it to a local timestamp. If the timezone of your system has not been correctly configured you might experience some mysterious problems. You can check that using SCF INFO SUBSYS $ZZKRN. There is a line containing the timezone offset.
0 new messages