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

Re: time zone and UTC issue [rant]



Ralf Mardorf <ralf.mardorf@rocketmail.com> writes:

> If the clock does use local time, then the time for all BIOS and all
> Linux files are ok.

This is not completely true.  If there is change from/to daylight
saving time to/from standard time between saving the files using the
BIOS and booting your Linux system the kernel will see wrong time
stamp on VFAT file systems.

When mounting a vfat file system the kernel will interpret the time
stamps in the file system according to the timezone set using
settimeofday(2).  This is usually set only once when the system boots
and it is set to current time offset in minutes compared to UTC.  If
this doesn't match the offset when the file were originally created on
the vfat file system, time stamps will be interpreted wrong.  I see
this often when I copy pictures from my digital camera's SD card.

IMO this is a flaw in the kernel.  The kernel should never use the
timezone set with settimeofday().  If should either have a more
sophisticated timezone handling or not use timezones at all.

A couple of years ago I have begun working on a kernel implementation
for full timezone handling and it worked.  But it was for linux 2.4
and the code was quite a quick hack.


urs


Reply to: