• HP tandem Cobol85 convert date-time to timestamp

    From Memmedaga Memmedov@21:1/5 to All on Thu Jul 8 06:26:33 2021
    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bill Honaker@21:1/5 to Memmedaga Memmedov on Thu Jul 8 11:51:48 2021
    On Thu, 8 Jul 2021 06:26:33 -0700 (PDT), Memmedaga Memmedov <mkeles84@gmail.com> wrote:

    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?

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Memmedaga Memmedov@21:1/5 to All on Sat Jul 10 12:19:20 2021
    @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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From wbreidbach@21:1/5 to Memmedaga Memmedov on Thu Aug 26 06:31:42 2021
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)