Sujet : Re: "A diagram of C23 basic types"
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 29. Apr 2025, 03:20:59
Autres entêtes
Organisation : None to speak of
Message-ID : <87wmb3zp10.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : Gnus/5.13 (Gnus v5.13)
Janis Papanagnou <janis_papanagnou+
ng@hotmail.com> writes:
[ Just noticed this post while catching up in my backlog, so I'm not
sure my questions/comments have already been addressed elsewhere. ]
>
On 16.04.2025 22:04, Scott Lurndal wrote:
[...]
Back in the mainframe days, it was common to use julian dates
as they were both concise (5 BCD digits/20 bits) and sortable.
YYDDD
If time was neeeded, it was seconds since midnight in a reference
timezone.
>
I don't quite understand the rationale behind all that said above.
>
"YYDDD" was used without century information? How is that useful?
(I assume it's just the popular laziness that later lead to all the
Y2k chaos activities.)
Yes, it was felt that saving storage (perhaps in the form of columns
on punch cards) was more important than supporting dates after 1999.
One relic of this is the tm_year member of struct tm in <time.h>,
which holds number of years since 1900. It was (I'm fairly sure)
originally just a 2-digit year number.
And "seconds since midnight" where taken despite the Julian Dates
have a day start at high noon (12:00)? [*]
The Julian day number used by astronomers does start at noon,
specifically at noon, Universal Time, Monday, January 1, 4713 BC
in the proleptic Julian calendar. As I write this, the current
Julian date is 2460794.591939746.
Outside of astronomy, the word Julian is (mis)used for just about
anything that counts days rather than months and days. A date
expressed in the form YYDDD (or YYYYDDD, or YYYYDDD) almost certainly
refers to a calendar day, starting and ending at midnight in some
time zone. See also the tm_yday member of struct tm, which counts
days since January 1 of the specified year.
[*] I recall that e.g. SunOS also had that wrong and assumed start at
midnight. Folks generally don't seem to be aware of that difference.
I don't recall SunOS using any kind of Julian days/dates for anything
at the system level, though some programs might. It used POSIX time,
counting seconds since 1970-01-01 00:00:00 UTC. I'd expect anything
other than an astronomical Julian date to assume correctly that
each day starts and ends at midnight in some specified time zone.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */