Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: printf and time_t Date: Wed, 07 Jan 2026 05:02:39 -0800 Organization: A noiseless patient Spider Lines: 17 Message-ID: <86o6n5pocw.fsf@linuxsc.com> References: <10jfol6$2u6r8$1@news.xmission.com> <10jfs23$2liif$1@dont-email.me> <10jgc2t$2rp4s$2@nntp.eternal-september.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Wed, 07 Jan 2026 13:02:46 +0000 (UTC) Injection-Info: dont-email.me; posting-host="96c89593a79aadfcc4daf354c711affa"; logging-data="610550"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4E0KLJ+ZsyTbYdbAIkHV4uo7yIrmao6g=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:2pomwTJrNtKtO33nzbVvuKmpLhw= sha1:2ZmlK5TFsvmbLdBoZ7hdoj1/zfg= Xref: csiph.com comp.lang.c:396261 James Kuyper writes: > On 2026-01-05 03:17, Andrey Tarasevich wrote: > >> On Sun 1/4/2026 11:19 PM, Kenny McCormack wrote: >> >>> The question is: How can you reliably printf() a time_t value? >>> What conversion spec should you use? >> >> You can't. As far as the language is concerned, `time_t` is intended >> to be an opaque type. It has to be a real type, ... > > In C99, it was only required to be an arithmetic type. I pointed out > that this would permit it to be, for example, double _Imaginary. [...] It's hard to imagine how time_t being an imaginary type could provide the semantics described in the C standard for time_t.