[jcifs] timezone problems

Christopher R. Hertel crh at ubiqx.mn.org
Tue Mar 9 18:22:19 GMT 2004

On Tue, Mar 09, 2004 at 03:01:08PM +0100, Julian Reschke wrote:
> Julian Reschke wrote:
> Running this script on W2K and Linux yields the following results:
> Host: Linux, Files on Linux (Samba): java.io.File and jcifs.smb.SmbFile 
> yield consistente results


> Host: W2K, File on W2K (Windows Networking): java.io.File returns 
> consistent dates, but jcifs.smb.SmbFile breaks the timestampe for the 
> "summer" file by substracting one hour

Either that or there's a problem with the JVM on Windows.  More...

> Host: W2K, File on Linux (Samba): java.io.File returns inconsistent 
> dates (file in summer is 60 minutes ahead), but jcifs.smb.SmbFile dates 
> are consistent

Your theory below is good, but I have another.  'Course, it's just a 

In the above, you say that java.io.File returns an inconsistent date when 
it accesses a file on a Samba server (I assume the Samba share is mounted 
locally on the W2K system so that java.io.File can access the file).

If that's the case, then jCIFS is out of the loop in that test.  Your 
theory that Samba is adjusting by 1 hour could still hold, but then we'd 
see that problem in other situations.  For example, you'd see it when you 
get a long listing in Windows Explorer.

I think I need to know more about this particular test, but it seems to me 
that it's just as likely that the W2K JVM is doing the adjusting here.

I also need to know which version of Samba you're running, and whether 
other clients see the hour shift you're reporting.

Chris -)-----

> Note in both cases the Java VMs were using equivalent time zones.
> Summary: both Samba and Jcifs seem to apply DST corrections. However 
> Samba and Windows (2000 and 2003) do not behave consistently -- that is 
> Samba itself doesn't seem to do the same thing as Windows, thus applying 
> the very correction works with JCifs vs Samba, but not with JCifs vs 
> Windows.
> Thought: at this point, JCifs doesn't seem to work consistently with a 
> Windows server. For me this *seems* to be caused by Samba not being 
> fully compatible to W2000 as server, and JCifs compensating for Samba 
> behaviour that the Windows servers I'm testing with do not expose.
> Regards, Julian
> -- 
> <green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760

"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org

More information about the jcifs mailing list