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)