[jcifs] timezone problems
julian.reschke at gmx.de
Tue Mar 9 19:02:02 GMT 2004
Christopher R. Hertel wrote:
> 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...
That was just the observation of the behaviour. As a matter of fact,
removing the TZ-mappings from JCifs fixes the inconsistencies on the
>>Host: W2K, File on Linux (Samba): java.io.File returns inconsistent
>>dates (file in summer is 60 minutes ahead), but jcifs.smb.SmbFile dates
> 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.
As a matter of fact, I do:
/home/public > date -r fsummer -u
Don Jun 22 00:00:00 UTC 2000
/home/public > date -r fwinter -u
Sam Dez 25 00:00:00 UTC 1999
W2K, Cygwin, Samba mount of /home/public:
//krusty/public> date -r fsummer -u
Thu Jun 22 01:00:00 UTC 2000
//krusty/public> date -r fwinter -u
Sat Dec 25 00:00:00 UTC 1999
(note the +1 hour difference for the file where lastmod falls into DST).
> 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.
With the example above, there's no Java VM involved at all.
> I also need to know which version of Samba you're running, and whether
> other clients see the hour shift you're reporting.
Version 2.2.0 (on Suse)
And yes, all clients see the same timestamps.
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760
More information about the jcifs