• HP tandem Cobol85 convert date-time to timestamp

    From Memmedaga@21:1/5 to All on Wed Jul 7 01:17:08 2021
    Hi,
    I can create timestamp value in realtime using "ENTER TAL "JULIANTIMESTAMP" GIVING S-TIMESTAMP"
    For example, timesamp 212492402667471197 date 20210707 time10242747
    Now, I want to create timesamp 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 Vincent Coen@21:1/5 to Memmedaga on Wed Jul 7 13:21:28 2021
    Hello Memmedaga!

    Wednesday July 07 2021 09:17, Memmedaga wrote to All:

    Hi,
    I can create timestamp value in realtime using "ENTER TAL
    "JULIANTIMESTAMP" GIVING S-TIMESTAMP" For example, timesamp 212492402667471197 date 20210707 time10242747 Now, I want to create
    timesamp value using input date and time. I mean date 20190101 time 23595900, I want to find what was timestamp value for previous dates?

    RTFM.


    Vincent

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dennis Lee Bieber@21:1/5 to All on Wed Jul 7 11:47:24 2021
    On Wed, 7 Jul 2021 01:17:08 -0700 (PDT), Memmedaga <mkeles84@gmail.com> declaimed the following:

    Hi,
    I can create timestamp value in realtime using "ENTER TAL "JULIANTIMESTAMP" GIVING S-TIMESTAMP"
    For example, timesamp 212492402667471197 date 20210707 time10242747
    Now, I want to create timesamp value using input date and time.
    I mean date 20190101 time 23595900, I want to find what was timestamp value for previous dates?

    Without documentation for that function it is difficult to provide advice.

    The astronomical Juliad Day for 20210707 is 2459402.5 (Julian day rolls over at noon, so midnight is 0.5 -- avoids nightly observations changing
    day num)

    Subtracting 2124924 from 2459402.5 and converting the result to calendar date seems to imply that Tandem is using October 3 3798 BC as a
    zero, when Julian Date proper uses January 1.5 [noon] 4713 BC as the zero
    date.


    --
    Wulfraed Dennis Lee Bieber AF6VN
    wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From pete dashwood@21:1/5 to Memmedaga on Mon Jul 12 20:03:12 2021
    On 7/07/2021 20:17, Memmedaga wrote:
    Hi,
    I can create timestamp value in realtime using "ENTER TAL "JULIANTIMESTAMP" GIVING S-TIMESTAMP"
    For example, timesamp 212492402667471197 date 20210707 time10242747
    Now, I want to create timesamp value using input date and time.
    I mean date 20190101 time 23595900, I want to find what was timestamp value for previous dates?


    The HP TAL language has no such function so this must be part of the
    COBOL support.

    It will be a program written in TAL and provided as a function for COBOL
    to use. (Maybe part of a COBOL "Library" provided with the Compiler...)

    It is not uncommon to write Julian converters or even provide them
    online so people can test date conversions both ways.

    Unfortunately, EITHER:

    1. The provided FUNCTION (JULIANTIMESTAMP) is wrong.

    Pretty unlikely, but not impossible...
    OR...

    2. It does NOT return a standard Julian time string...

    OR...

    3. The STRING YOU POSTED HERE is incorrect.

    I tested your string through several Julian converters and here's a comprehensive description of what they made of it:

    The calendar date for 212492402667471197 is 299817663961704000:0:0.00 UT
    on September 30, 581784438190380 .

    Some different formats for your copying and pasting pleasure:

    September 30 581784438190380
    30/9/581784438190380 day/month/year
    9/30/581784438190380 month/day/year
    30-9-581784438190380 day-month-year
    9-30-581784438190380 month-day-year 30/9/581784438190380/299817663961704000/0/0.00 day/month/year/hour/minute/second
    30/9/5817844380380
    9/30/5817844380380
    30-9-5817844380380
    9-30-5817844380380
    This is nonsense.

    The Julian string for the date and time you requested {date 20190101
    time 23595900}, is: 2458485.49999

    Note that it contains a decimal point. Your string does not.

    Just to check, I ran it back and got:

    The calendar date for 2458485.49999 is 23:59:59.14 UT on January 1, 2019

    Given that at least 3 converters I used all gave the same results, it is reasonable to assume that there is a standard conversion algorithm and
    we would expect the HP routine to use it.

    However, my curiosity was piqued now so I decided to find out more about
    this routine.

    It comes in different flavours but there is a comprehensive description
    of the parameters to it and what it does here:

    http://nonstoptools.com/manuals/Guardian-D-ProcCalls.pdf

    "A 64-bit Julian timestamp is based on the Julian Date. It is a quantity
    equal to the number of microseconds since 12:00 (noon) Greenwich mean
    time (Julian proleptic calendar) January 1, 4713 B.C. This timestamp can represent either Greenwich mean time, local standard time, or local
    civil time. There is no way to examine a Julian timestamp and determine
    which of the three times it represents. "

    There is enough information in the document linked above, for you to
    create your own algorithm, decipher the time and date from it, and do
    vice versa. There are also some other functions you could look at that
    may help significantly.

    If you would like to have it done for you, contact me and I'll give you
    a price.

    Cheers,

    Pete.




    --
    I used to write *COBOL*; now I can do *anything*...

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