[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: difference in seconds between two formatted dates ...



On Thu 21 Dec 2023 at 07:15:12 (-0500), Greg Wooledge wrote:
> On Wed, Dec 20, 2023 at 10:52:33PM -0600, David Wright wrote:
> > Sorry for the synecdoche, but I think it expresses the comprehensive
> > setting of UTC across the entirety of the computer and its operating
> > system, from the RTC, through /etc/timezone and /etc/localhost, to
> > the users' sessions. By this active (not just default) means, users
> > can remain blissfully unaware of the effects of setting timezones
> > other than UTC, just as the OP appeared to be, until reminded.
> 
> I'm not even sure what you're trying to say here.

I'm trying to explain something I thought was a simple concept,
an "all-UTC machine". So I suggested how you might make one.
Take a PC, turn it on, and set the CMOS clock to UTC. Boot it up,
run dpkg-reconfigure tzdata and set UTC as the timezone.

> "Active"?  Do you
> think /etc/timezone and /etc/localhost somehow have agency?  That
> they have intent?

No, I just meant that /you/ actively set everything that you could
to UTC, as if your universe was set in London on a wintry day.

> They're just settings.

Yes, and I just meant that you'd have to set the machine's System
Timetone to UTC. I'll hazard a guess that most people here won't
have that already set as their system timezone.

What would "passive" settings be? I don't know, but I've just
seen the term used in this thread:

  https://lists.debian.org/debian-user/2023/12/msg01131.html

> As far as the RTC (real time clock) goes, that just exists to
> bootstrap the system clock at boot time, before NTP takes over.
> If the system isn't connected to a network with a time server
> available, then of course NTP never takes over, and the system clock
> tries its best to keep up with time based on the initial RTC value,
> unless/until a sysadmin decides to run a date command to set the
> system clock more accurately.

Exactly, so the RTC is the primary source of time for a system in
the so-called "unexposed" mode of operation.

> Again, there isn't any agency here.  The RTC is just a resource that
> the system can use, once per boot, to get things started.  It could
> be set correctly, or incorrectly.  It could be set to local time, as
> was common when dual-booting with Windows, or to UTC.  On systems
> that run NTP, the RTC is mostly vestigial.  Its setting has very
> little effect on anything -- perhaps some early logfile timestamps.

Bear in mind that I was explaining my use of "all-UTC machine".
Were you to construct such a beast, I think the first thing you
might set, actively, is the RTC. You wouldn't just assume that
it was already set to UTC.

What would be a better term for such a machine in the state described?

Anyway, having followed these actions, someone could now write and
test scripts without worrying about timezones, and then find out that
they fail when someone in the real world runs them. Which is what
I posted in:

  https://lists.debian.org/debian-user/2023/12/msg00915.html

on my "exposed" "America/Chicago machine".

Cheers,
David.


Reply to: