different times for last boot between last and uptime -s

gene heskett gheskett at shentel.net
Tue Dec 6 05:05:06 UTC 2022


On 12/5/22 23:04, Ralf Mardorf via ubuntu-users wrote:
> On Tue, 2022-12-06 at 04:24 +0100, Ralf Mardorf wrote:
>> Since your RTC is at UTC, you are missing an hour as long as no service
>> was started to initialize the system clock.
> 
> PS:
> 
> The system clock is a software clock, so if you start booting only the
> time of the battery buffered hardware clock can be used and it is
> interpreted to represent UTC, since the software clock isn't initialized
> the system can't know at what timezone you are. During the startup a
> service does initialize the software clock, hence later the system knows
> that you are at CET and not at UTC. To avoid an 1 hour mismatch you need
> to set your hardware clock to CET instead of UTC.
> 
> So again
>> TimeUSec=Mon 2022-12-05 23:10:39 CET
>> RTCTimeUSec=Mon 2022-12-05 23:10:40 CET
>                               ^^       ^^^
> is for
>    RTCTimeUSec=Mon 2022-12-05 22:10:40 UTC
>                               ^^       ^^^
> 
> To avoid the mismatch it should read
> 
>    TimeUSec=Mon 2022-12-05 23:10:39 CET
>    RTCTimeUSec=Mon 2022-12-06 00:10:40 CET
> 
> If you restart your machine and take a look at the time by the BIOS, you
> will notice that the BIOS does not show Europe/Berlin time. It is 1 hour
> behind. If the time in Berlin is 23:10, your BIOS does show 22:10.
> 
> You could migrate from LocalRTC=no to LocalRTC=yes and set the hardware
> clock, if you shouldn't need UTC, but keep in mind that this approach
> also has got serious disadvantages related to timestamps, if you e.g.
> sync files by keeping files with newer timestamps and deleting files
> with older timestamps changing between standard time and DST or between
> timezones could cause trouble. I'm in favour of LocalRTC=yes, but I
> neither sync files by a timestamp related approach, nor do I travel
> through different timezones.
> 
Actually Ralf, the OP could have an erronious Locale entry, or a very 
stale tzdata file. I much prefer the HWclock is on UTC and the tzdata 
file is updated when apt wants to update it, then if Locale is correct, 
the date query should return the local time, with the HWClock on UIC. 
And everything Just Works.
> 
> 

Cheers, Gene Heskett.
-- 
"There are four boxes to be used in defense of liberty:
  soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
  - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/>





More information about the ubuntu-users mailing list