delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/02/28/13:21:36

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Tue, 28 Feb 2012 19:20:24 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Problem with daylight saving time, off by one hour
Message-ID: <20120228182024.GK23440@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <63813 DOT 141 DOT 155 DOT 196 DOT 239 DOT 1330441201 DOT squirrel AT mail DOT farance DOT com> <20120228154850 DOT GH23440 AT calimero DOT vinschen DOT de> <49324 DOT 141 DOT 155 DOT 196 DOT 239 DOT 1330445991 DOT squirrel AT mail DOT farance DOT com> <20120228165457 DOT GJ23440 AT calimero DOT vinschen DOT de> <50546 DOT 141 DOT 155 DOT 196 DOT 239 DOT 1330449825 DOT squirrel AT mail DOT farance DOT com>
MIME-Version: 1.0
In-Reply-To: <50546.141.155.196.239.1330449825.squirrel@mail.farance.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Feb 28 12:23, Frank Farance wrote:
> > Not for me.  The only difference I see is that I'm living in another
> > timezone.  I changed my timezone to America/New_York as well, but the time
> > is still correct in ls. Without a reproducible scenario (which does not
> > involve non-system, non-Cygwin tools like winSCP) it's pretty hard to
> > track down why you see the wrong time information.
> 
> Corinna, maybe my point wasn't clear above.  I mentioned WinSCP to reveal
> how the files arrived.  However, it was via ***Windows*** tools where I
> was able to see the timestamp: (1) a right-click->properties on the file

You made your point entirely clear.  But I really hope I made my point
as clear as well.  In theory it shouldn't matter how the files arrived
on the machine.  Still, there is the problem of reproducibility.  For
clearness:

- My Windows timezone is "(UTC+01:00) Amsterdam, Berlin, Bern, Rome,
  Stockholm, Vienna", which is +1 from UTC, +2 in DST.

- My C:\Windows folder has a modification timestamp of 2011-07-16 10:15
  in a standard Windows Explorer folder view.

- In CMD: dir C:\ prints
    [...]
    16.07.2011  09:15    <DIR>          Windows

  Note that it does NOT print 10:15!

- In a Cygwin shell:

  tcsh$ echo $TZ
  Europe/Berlin
  tcsh$ cd /cygdrive/c
  tcsh$ ls -ld --full-time Windows
  drwxrwx---+ 1 ???????? ???????? 0 2011-07-16 10:15:47.190400000 +0200 Windows

So Explorer and Cygwin agree on the time, only CMD is an hour off because
CMD apparently ignores the fact that the file's modification timestamp
is within DST, so it does not add an hour.

Another example involving a cp from a remote machine:

- Linux:

  tcsh$ echo $TZ
  Europe/Berlin
  tcsh$ ls -l --full-time x
  -rw-r--r--. 1 corinna vinschen 12849 2007-07-24 16:47:48.000000000 +0200 x

- Cygwin:

  tcsh$ cp -p //linux/share/x .
  tcsh$ ls -ld --full-time x
  -rw-r--r-- 1 corinna vinschen 12849 2007-07-24 16:47:48.000000000 +0200 x
 
- CMD:

  dir x
  24.07.2007  15:47            12.849 x

- Windows Explorer shows a timestamp of 2007-07-24 16:47.

Here, too, all affected parties agree on the timestamp, only CMD
doesn't.  A change to another Windows timezone only offsets the
timestamps, but doesn't change the general picture.

> shows the correct timestamp, (2) I just tried "dir" from the command line
> and got the right time, (3) but "ls -l --full-time" shows the wrong time
> <-- all reproduced by system or cygwin tools.

Which is kind of weird, because that's *exactly* inverse to what I observe
on my machine.

> FYI, I just tried a different folder that has winter files and all three
> steps above report the same time.  This would dispell the idea that I had
> the wrong time zone, right?

Well... probably.  What strikes me as weird is the exact opposite behaviour
from what I see.  If the file is a DST file, but Explorer and CMD don't
disagree by an hour, what does that mean?  That would mean that Explorer
doesn't treat the DST timestamp as DST timestamp for some reason.

> How would you like me to debug this further?  Thanks!

I don't know.  I can't see that anything's wrong with Cygwin here.  I
just searched the web and found other people having timestamp problems
with WinSCP without any Cygwin involvement:

  http://winscp.net/forum/viewtopic.php?t=8382

Maybe it *is* winSCP, after all?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019