You wrote:
>>An interesting thought. UNIXes use a 32-bit signed integer to count
>>the number of seconds. Their birthdate (or epoch) is 1 Jan 1970. That
>>gives us some 68 years plus or minus 1970 = 1902-2038 as the useful
>>date range in UNIX (for date calcs).
>>
>>Now, I don't even pretend to know the inner works of OS/400 or the
>>AS/400 systems. However, it occurs that IBM markets the RISC systems
>>as 64-bit architecture. Therefore:
>>
>>Why not establish a standard date conversion schema: a 64-bit signed
>>integer representing the number of seconds from some date. The "some
>>date is largely irrelevant. Here's why: 2^63 (one bit for sign left
>>off) gives us some 9.223372037x10^18, or 9223372037000000000 seconds
>>(according to my Texas Instruments TI-35X calculator (I'm not really a
>>math person, either.) That calculates to 2.922710231x10^11 =
>>292,271,023,100 years. That is 292 BILLION years. In each direction.
>>Counting from 0 AD, 1970 AD, or 2000 AD doesn't really make a
>>difference.
-snip-
>>What does everyone think? I personally don't think it's impossible.
>>It's very much the cleanest format I could think of. It doesn't care
>>what your date format is. It is easily extendable. Thoughts? Or am I
>>crazy??? ^_^
Loyd, here's bit from the ILE date/time API section. I believe these are the APIS that support date calculations in RPG. It says to me that you're not crazy, in fact, with mods it's what IBM is doing.
The Get Current Local Time (CEELOCT) API returns the
current local time in three formats: Lilian date (the number of
days since 14 October 1582), Lilian timestamp (the number
of seconds since 00:00:00 14 October 1582), and Gregorian
character string (in the form YYYYMMDDHHMISS999').
These values are compatible with the other ILE date and
time APIs and with existing language intrinsic functions. <<RPG date functions>>
CEELOCT performs the same service, faster, than calling
CEEUTC, CEEUTCO, and CEEDATM in succession.
Required Parameter Group
output_Lilian (output)
A 32-bit binary integer representing the current local
date in the Lilian format. That is, day 1 is 15 October
1582, day 148 887 is 4 June 1990. If local time is not
available from the system, output_Lilian is set to 0 and
CEELOCT ends with a nonzero feedback code.
output_seconds (output)
A 64-bit double floating point number representing the
current local date and time as the number of seconds
since 00:00:00 on 14 October 1582. For example,
00:00:01 on 15 October 1582 is second number 86 401
(24*60*60 + 01). 19:00:01.078 on 4 June 1990 is
second number 12 863 905 201.078. If local time is not
available from the system, output_seconds is set to 0
and CEELOCT ends with a nonzero feedback code.
output_Gregorian (output)
A 17-byte character string in the form
YYYYMMDDHHMISS999 representing local year, month,
day, hour, minute, second, and millisecond.
15 Oct 1582 is the date of adoption of the Gregorian calendar. The range selected by IBM is 1582/10/15 to 9999/12/31. That should be plenty for all of us.
BTW, it seems to me that Unices suffer from the same kind of limitations that Glenn has brought up about bracketing schemes.
Cheers
+--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to "MIDRANGE-L@midrange.com". | To unsubscribe from this list send email to MAJORDOMO@midrange.com | and specify 'unsubscribe MIDRANGE-L' in the body of your message. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.