From: Paul Eggert <eggert@cs.ucla.edu>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] manual: Add more documentation for the tm_isdst member of struct tm
Date: Wed, 26 Oct 2022 12:05:07 -0700 [thread overview]
Message-ID: <6b01632f-047c-c18f-5616-4037bfe706fa@cs.ucla.edu> (raw)
In-Reply-To: <874jvqvnih.fsf@oldenburg.str.redhat.com>
On 2022-10-26 04:21, Florian Weimer wrote:
> * Paul Eggert:
>
>> On 2022-10-25 11:07, Florian Weimer wrote:
>>
>>> I think in other cases, tz goes with actual practices on the ground
>>
>> There is no real practice on the ground here, as nobody outside of
>> libc nerds cares (or should care) whether tm_isdst is zero or
>> positive.
>
> That's not my experience. We have heard from customers that they use
> non-negative values in their applications.
Oh, by "practice on the ground" I meant ordinary people and mass media
and the like, not software developers who have to deal with the tm_isdst
mess.
> Maybe we should just document that applications should set this field to
> -1 when constructing struct tm data?
Yes, if you're deriving struct tm data from the outside world and you
have no idea what tm_isdst etc. should be, your apps should set tm_isdst
to -1. However, if the outside world tells you tm_gmtoff (which is
pretty common these days, e.g., see the "Date:" line in this email),
then your apps should also set tm_gmtoff to what the outside world tells
you, before you call mktime.
> In case of Ireland it seems an artificial complication, though. The
> perception seems to be that IST is summer time, not standard time
My impression is different, in that people in Ireland typically say
"summer time" or "winter time". They typically do not say "standard
time" or "daylight saving time". And as it happens, summer time =
standard time in Ireland.
Part of the confusion here is that the British English phrase "summer
time" is not the same thing as the American English phrase "daylight
saving time". The two phrases mean the same thing for UK and US
timekeeping, but not for Irish timekeeping. Since the Irish typically
use British English, they refer to their timekeeping correctly.
I think this confusion is partly why POSIX sometimes says "alternative
time" instead of "daylight saving time" - it's trying to avoid using
either British or American English and thus avoid the confusion. Though
I wish POSIX would stick to just one phrase rather than using two, since
the two phrases in POSIX mean the same thing. I expect the problem here
is that the C Standard says "daylight saving time" and POSIX copies from
that when it has to, and uses "alternative time" when it doesn't. Though
the use of two terms in POSIX simply adds to the confusion....
next prev parent reply other threads:[~2022-10-26 19:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-24 12:51 Florian Weimer
2022-10-24 19:44 ` Paul Eggert
2022-10-24 21:13 ` Florian Weimer
2022-10-25 17:49 ` Paul Eggert
2022-10-25 18:07 ` Florian Weimer
2022-10-25 18:27 ` Paul Eggert
2022-10-26 11:21 ` Florian Weimer
2022-10-26 19:05 ` Paul Eggert [this message]
2022-10-27 10:09 ` Florian Weimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6b01632f-047c-c18f-5616-4037bfe706fa@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).