How does Linux handle DST/ST? It's all about time...

Bruce Labitt bruce.labitt at myfairpoint.net
Tue Nov 10 12:01:32 EST 2020


Still looking at a time related bug.  Wondering how (nowadays) linux 
handles TZ and DST/ST transition.

Does linux embed DST state into TZ?  Or is there a variable with a name 
like "DST"?

I want to set two different machines, one a PC, the other a dumb 
instrument to the same time.  The dumb one doesn't do time adjustment.  
My PC, obviously does.

I want to create a time, on my PC called: mytime = utc + utc_offset.  If 
utc_offset is invariant, then I am all set.  All I can see is (at least 
for ubuntu) there is TZ, which appears to be equal to utc_offset + DST*1.

If there was a variable called DST, I'd be done.  Then mytime = utc + 
utc_offset -DST*1, where DST=1 if now is daylight savings time, or DST=0 
if now is standard time.

Anyone have insight on this?  All I know is that my dumb machine was set 
to DST last month.  My PC is DST corrected.  Half the time, (all during 
ST) the device clock is ahead of the PC clock. Why is this bad - because 
the PC refuses to read files timestamped in the future.  I do not want 
to correct the dumb machine's clock twice a year, as there is documented 
potential for destroying data.  This should be correctable on the PC 
end, shouldn't it?



More information about the gnhlug-discuss mailing list