Groups | Search | Server Info | Keyboard shortcuts | Login | Register
Groups > comp.lang.c > #392634
| From | Keith Thompson <Keith.S.Thompson+u@gmail.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: "A diagram of C23 basic types" |
| Date | 2025-04-16 16:11 -0700 |
| Organization | None to speak of |
| Message-ID | <87zfgfzoqi.fsf@nosuchdomain.example.com> (permalink) |
| References | (9 earlier) <87plhd0z76.fsf@nosuchdomain.example.com> <slrnvvvdch.3gc99.candycanearter07@candydeb.host.invalid> <87cydb28gu.fsf@nosuchdomain.example.com> <S2ULP.1346551$BrX.394554@fx12.iad> <vtp6hq$3349g$1@dont-email.me> |
BGB <cr88192@gmail.com> writes:
> On 4/16/2025 3:04 PM, Scott Lurndal wrote:
>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>> candycanearter07 <candycanearter07@candycanearter07.nomail.afraid>
>>> writes:
[...]
>>>> Datetime is a nightmare, this is why we use a simple seconds-since-X
>>>> system.
>>>
>>> Indeed. That makes it a slightly less unpleasant nightmare.
>> 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.
>
> One shorthand is to assume a year is 365.25 days (31557600 seconds),
> and then base everything else off this (initially ignoring things like
> leap-years, etc, just assume that the number of days per year is
> fractional).
>
> Then, say, 2629800 seconds per month, ...
So, a month is 30 days, 26 hours, and 15 minutes. How is that useful?
> For some other calculations, one can assume an integer number of days
> (365), just that each day is 0.07% longer.
>
> For date/time calculations, one could then "guess" the date, and
> jitter it back/forth as needed until it was consistent with the
> calendar math.
>
> Estimate and subtract the year, estimate and subtract the month, then
> the day. Then if we have landed on the wrong day, adjust until it
> fits.
>
> Not really sure if there was a more standard way to do this.
Keeping track of time in a manner that's entirely consistent with
the Gregorian calendar is a solved problem. C's standard library
has functions that will do that for you. What is the point of
inventing a new and less accurate approximation?
[...]
> As for time since epoch:
> Microseconds (in a power-of-10 sense) are more common...
The C standard library already has "struct timespec", which represents
time with nanosecond precision. Why invent something new with poorer
precision?
[...]
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar
Re: "A diagram of C23 basic types" candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2025-04-07 17:30 +0000
Re: "A diagram of C23 basic types" Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-04-07 21:49 +0200
Re: "A diagram of C23 basic types" candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2025-04-08 18:40 +0000
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-14 04:33 +0000
Re: "A diagram of C23 basic types" candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2025-04-14 17:40 +0000
Re: "A diagram of C23 basic types" Kaz Kylheku <643-408-1753@kylheku.com> - 2025-04-14 17:46 +0000
Re: "A diagram of C23 basic types" Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-04-15 09:41 +0200
Re: "A diagram of C23 basic types" BGB <cr88192@gmail.com> - 2025-04-14 13:36 -0500
Re: "A diagram of C23 basic types" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-14 15:15 -0700
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-14 22:33 +0000
Re: "A diagram of C23 basic types" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-14 15:56 -0700
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-14 23:41 +0000
Re: "A diagram of C23 basic types" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-14 17:57 -0700
Re: "A diagram of C23 basic types" James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-04-14 23:25 -0400
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-15 04:11 +0000
Re: "A diagram of C23 basic types" James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-04-15 10:06 -0400
Re: "A diagram of C23 basic types" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-15 15:56 -0700
Re: "A diagram of C23 basic types" "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-04-15 17:04 -0700
Re: "A diagram of C23 basic types" James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-04-15 20:53 -0400
Re: "A diagram of C23 basic types" David Brown <david.brown@hesbynett.no> - 2025-04-17 17:56 +0200
Re: "A diagram of C23 basic types" Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-04-19 09:46 +0200
Re: "A diagram of C23 basic types" David Brown <david.brown@hesbynett.no> - 2025-04-19 17:15 +0200
Re: "A diagram of C23 basic types" Michael S <already5chosen@yahoo.com> - 2025-04-19 23:15 +0300
Re: "A diagram of C23 basic types" David Brown <david.brown@hesbynett.no> - 2025-04-21 20:34 +0200
Re: "A diagram of C23 basic types" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-21 14:28 -0700
Re: "A diagram of C23 basic types" Michael S <already5chosen@yahoo.com> - 2025-04-22 01:07 +0300
Re: "A diagram of C23 basic types" candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2025-04-22 19:30 +0000
Re: "A diagram of C23 basic types" Michael S <already5chosen@yahoo.com> - 2025-04-22 00:28 +0300
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-15 22:58 +0000
Re: "A diagram of C23 basic types" James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-04-15 21:02 -0400
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-16 07:42 +0000
Re: "A diagram of C23 basic types" BGB <cr88192@gmail.com> - 2025-04-15 00:00 -0500
Re: "A diagram of C23 basic types" scott@slp53.sl.home (Scott Lurndal) - 2025-04-15 14:08 +0000
Re: "A diagram of C23 basic types" BGB <cr88192@gmail.com> - 2025-04-15 12:29 -0500
Re: "A diagram of C23 basic types" James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-04-15 18:57 -0400
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-15 23:01 +0000
Re: "A diagram of C23 basic types" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-15 17:10 -0700
Re: "A diagram of C23 basic types" Kaz Kylheku <643-408-1753@kylheku.com> - 2025-04-16 02:11 +0000
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-15 23:00 +0000
Re: "A diagram of C23 basic types" "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-04-14 18:46 -0700
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-15 04:14 +0000
Re: "A diagram of C23 basic types" James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-04-15 10:19 -0400
Re: "A diagram of C23 basic types" Kaz Kylheku <643-408-1753@kylheku.com> - 2025-04-15 14:28 +0000
Re: "A diagram of C23 basic types" "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-04-15 12:17 -0700
Re: "A diagram of C23 basic types" "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-04-15 16:20 -0700
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-17 03:03 +0000
Re: "A diagram of C23 basic types" "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-04-16 22:34 -0700
Re: "A diagram of C23 basic types" "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-04-16 22:38 -0700
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-15 23:10 +0000
Re: "A diagram of C23 basic types" BGB <cr88192@gmail.com> - 2025-04-14 19:43 -0500
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-15 04:15 +0000
Re: "A diagram of C23 basic types" BGB <cr88192@gmail.com> - 2025-04-15 00:40 -0500
Re: "A diagram of C23 basic types" David Brown <david.brown@hesbynett.no> - 2025-04-15 19:22 +0200
Re: "A diagram of C23 basic types" BGB <cr88192@gmail.com> - 2025-04-15 12:54 -0500
Re: "A diagram of C23 basic types" scott@slp53.sl.home (Scott Lurndal) - 2025-04-15 19:10 +0000
Re: "A diagram of C23 basic types" BGB <cr88192@gmail.com> - 2025-04-15 19:54 -0500
Re: "A diagram of C23 basic types" David Brown <david.brown@hesbynett.no> - 2025-04-18 20:03 +0200
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-15 22:56 +0000
Re: "A diagram of C23 basic types" BGB <cr88192@gmail.com> - 2025-04-15 23:48 -0500
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-16 07:41 +0000
Re: "A diagram of C23 basic types" David Brown <david.brown@hesbynett.no> - 2025-04-18 20:10 +0200
Re: "A diagram of C23 basic types" scott@slp53.sl.home (Scott Lurndal) - 2025-04-15 14:10 +0000
Re: "A diagram of C23 basic types" BGB <cr88192@gmail.com> - 2025-04-15 13:00 -0500
Re: "A diagram of C23 basic types" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-15 16:42 -0700
Re: "A diagram of C23 basic types" candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2025-04-16 14:00 +0000
Re: "A diagram of C23 basic types" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-16 12:48 -0700
Re: "A diagram of C23 basic types" scott@slp53.sl.home (Scott Lurndal) - 2025-04-16 20:04 +0000
Re: "A diagram of C23 basic types" BGB <cr88192@gmail.com> - 2025-04-16 16:10 -0500
Re: "A diagram of C23 basic types" Richard Heathfield <rjh@cpax.org.uk> - 2025-04-16 23:13 +0100
Re: "A diagram of C23 basic types" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-16 16:31 -0700
Re: "A diagram of C23 basic types" Richard Heathfield <rjh@cpax.org.uk> - 2025-04-17 01:05 +0100
Re: "A diagram of C23 basic types" Kaz Kylheku <643-408-1753@kylheku.com> - 2025-04-17 01:26 +0000
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-17 23:18 +0000
Re: "A diagram of C23 basic types" Richard Heathfield <rjh@cpax.org.uk> - 2025-04-28 07:52 +0100
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-30 23:57 +0000
Re: "A diagram of C23 basic types" Richard Heathfield <rjh@cpax.org.uk> - 2025-05-01 06:17 +0100
Re: "A diagram of C23 basic types" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-16 16:11 -0700
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-17 23:16 +0000
Re: "A diagram of C23 basic types" Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-04-29 02:10 +0200
Re: "A diagram of C23 basic types" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-28 19:20 -0700
Re: "A diagram of C23 basic types" Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-04-29 08:37 +0200
Re: "A diagram of C23 basic types" scott@slp53.sl.home (Scott Lurndal) - 2025-04-29 13:14 +0000
Re: "A diagram of C23 basic types" James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-04-28 23:34 -0400
Re: "A diagram of C23 basic types" Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-04-29 08:44 +0200
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-30 23:58 +0000
Re: "A diagram of C23 basic types" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-30 17:15 -0700
Re: "A diagram of C23 basic types" candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2025-04-29 05:10 +0000
Re: "A diagram of C23 basic types" James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-04-29 01:24 -0400
Re: "A diagram of C23 basic types" BGB <cr88192@gmail.com> - 2025-04-29 13:02 -0500
Re: "A diagram of C23 basic types" Richard Heathfield <rjh@cpax.org.uk> - 2025-04-29 19:25 +0100
Re: "A diagram of C23 basic types" scott@slp53.sl.home (Scott Lurndal) - 2025-04-29 19:00 +0000
Re: "A diagram of C23 basic types" Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-08 02:27 +0000
csiph-web