[Samba] timestamp OK, but not displayed correctly

Adrian Tam adtam at cup.hp.com
Tue Apr 22 23:50:30 GMT 2003


I had looked at this problem way back in 2.0.x code. The problem was two
fold. First you have to understand how windows stores time.

It is important to note that Windows systems always store time in GMT 
and no timezone information is stored. The time is converted to 
whatever timezone is set in Date/Time Properties on the system at the 
time a file's properties is opened. This causes some strange behaviour 
on file times. Here are the various scenarios.

1. If the file was created while the computer is in standard time and 
later opened in
  a) standard time:
     The file will show the original correct time.
  b) daylight saving time:
     The time will be off by +1 hour because the standard time 
is "converted" to daylight time.

2. If the file was created while the computer is in daylight time and 
later opened in
  a) standard time:
     The time will be off by -1 hour because the daylight time 
is "converted" to standard time.
  b) daylight saving time:
     The time will be the original time.

This behaviour applies even to the local file on a Windows system. If 
you have a folder with a file created in standard time and another one 
in daylight time and you note down the time displayed when they were 
created, you will find that, at any given time, only one of the files 
will show the original date!

Having said that, there was a small problem with samba 2.0.x code that I
am not sure still exist now. In the old code, a static variable is used
to store server time zone. It is initialized on connection but never
updated. So if a standard/daylight switch happens during the lifetime of
the connection, then files created after the switch will have the wrong
timestamp. But because of the way windows behave, it would seem to the
user that the files created before the switch has the wrong timestamp!

Adrian Tam
adrian.tam at hp.com


-----Original Message-----
From: samba-bounces+marc_jacobsen=hp.com at lists.samba.org
[mailto:samba-bounces+marc_jacobsen=hp.com at lists.samba.org] On Behalf Of
Peer-Joachim Koch
Sent: Wednesday, April 16, 2003 2:00 AM
To: samba at lists.samba.org
Subject: [Samba] timestamp OK, but not displayed correctly


Hi,

we found that the timestamp of files is not displayed correctly, since
the time switched to summer time. The file server has the right time and
under unix the "ls -l" shows the correct time, but under windows 1h is
added (all files seems to live in the future).

Any hint ?

Bye,
    Peer _________________________________________________________
Max-Planck-Institut fuer Biogeochemie
Dr. Peer-Joachim Koch
Winzerlaer Str.10            Telefon: ++49 3641 57 6705
D-07745 Jena                 Telefax: ++49 3641 57 7864
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba



More information about the samba mailing list