Timestamps shifted 1 hour between 25th & 31st Oct - DST bug?

Advertisement

PCH
Joined:
Posts:
3
Location:
Southampton, UK

Timestamps shifted 1 hour between 25th & 31st Oct - DST bug?

Local machine OS WinXP sp3.
Remote machine OS Debian Linux
Current timezones GMT (UTC +0000), Not in DST.
Winscp version 4.1.9
Protocol in use SCP
Environment Timezone offset 0
Environment DST mode - adjust remote timestamp to local conventions (UNIX)
Transfer Preferences - Preserve timestamp
GUI Interface: Norton Commander style

Transferring from local to remote files with various dates but all with 10:00 timestamps:
Files dated shortly before 25th Oct are correctly stored on remote server with dst adjustment as 10:00 +0100 e.g.
-rw-r--r-- 1 pete pete 39 2009-10-24 10:00:00.000000000 +0100 24.bin

Files dated after 31st October are also correctly store without dst adjustment e.g.
-rw-r--r-- 1 pete pete 39 2009-11-01 10:00:00.000000000 +0000 01.bin

However, files dated between 25th and 31st October 2009 correctly loose the +0100 dst offset but the UTC time is decremented by one hour e.g.
-rw-r--r-- 1 pete pete 39 2009-10-26 09:00:00.000000000 +0000 26.bin
-rw-r--r-- 1 pete pete 39 2009-10-31 09:00:00.000000000 +0000 31.bin

Subsequent local to server file synchronisation fails as WinSCP always thinks these local files are 1 hour newer.

(The transition to DST in March was handled correctly.)

Using SFTP protocol gives the same result on the server but in the WinSCP GUI the remote server display times are corrected and synchronisation works as expected.

This happens with two different remote servers, though both run Debian Linux, and using another WinXP machine on another network to the same servers.

Comparing SCP & SFTP actions, as the end result on the server is the same but WinSCP display & synchronisation behaviour is different, this leads me to suspect a bug in WinSCP rather than Debian Linux or WinXP.

Is this repeatable on other Win/Linux systems & timezones?


Timestamps shifted 1 hour between 25th & 31st Oct - DST bug?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,440
Location:
Prague, Czechia

Re: Timestamps shifted 1 hour between 25th & 31st Oct - DST bug?

Thanks for detailed report. Is there anything special about the two days? When did DST ended in UK this year? What is your local regional options setting? Is it UK?

Comparing SCP & SFTP actions, as the end result on the server is the same but WinSCP display & synchronisation behaviour is different, this leads me to suspect a bug in WinSCP rather than Debian Linux or WinXP.
I didn't understand what difference you see in SFTP vs SCP actions.

Reply with quote

PCH
Joined:
Posts:
3
Location:
Southampton, UK

What I think is special is that UK DST ended at 02:00 (local dst) on 25th October 2009. The US DST ended on 1st November 2009, that might be relevant. The files with the incorrect timestamps are between 2009/10/25 02:00:00 and 2009/11/01 01:59:59 (as displayed on WinXP system).

I'm in the UK and both the Linux servers I use are on UK locale settings, and DST settings for this year are:

/etc/localtime Sun Mar 29 00:59:59 2009 UTC = Sun Mar 29 00:59:59 2009 GMT isdst=0 gmtoff=0
/etc/localtime Sun Mar 29 01:00:00 2009 UTC = Sun Mar 29 02:00:00 2009 BST isdst=1 gmtoff=3600
/etc/localtime Sun Oct 25 00:59:59 2009 UTC = Sun Oct 25 01:59:59 2009 BST isdst=1 gmtoff=3600
/etc/localtime Sun Oct 25 01:00:00 2009 UTC = Sun Oct 25 01:00:00 2009 GMT isdst=0 gmtoff=0

Regarding SCP & SFTP actions, the results are the same when looking on the server - for an affected file the shell command
ls -la --time-style=full-iso
returns
-rw-r--r-- 1 pete pete 39 2009-10-25 09:00:00.000000000 +0000 25.bin
[this should read ... 10:00:00.000000000 +0000 ...]

If you are running WinSCP using SCP the remote window 'changed' value is displayed as 25/10/2009 09:00:00 and the 'synchronise remote with local' command will flag this file for copying from local to remote again due to the 1 hour difference.

If you are running WinSCP using SFTP with exactly the same files the remote window 'changed' value is displayed as 20/10/2009 10:00:00 and the 'synchronise remote with local' command will say there are no differences.

[It's very handy that you can run two WinSCP sessions at once, one with using SCP and the other SFTP]

This fault seems to be unique to this year. Files dated around end of DST in 2008 and 2010 are handled correctly.

Reply with quote

PCH
Joined:
Posts:
3
Location:
Southampton, UK

Just to update and close this thread.

Bug was found in the way WinSCP works out the DST change dates on WinXP (and maybe later versions of Windows). For last <day of week> of the month, Windows registry basically says DST date is the 5th <day of week> of the month. The client program must change this to the 4th <day of week> of the month if the date otherwise falls in the next month. WinSCP wasn't doing this when the date came to be the 1st of the next month. Hence any DST change date of 25th (October or March) was incorrectly made 1st of the next month. To my knowledge this affected March 2007 and October 2009 in European timezones.

This is currently listed as bug 504 on https://winscp.net/eng/docs/history in the 'not released yet' section, 4.2.4 being the latest release.

Thanks to Prikryl for a quick fix. :D

I'll be making a donation to the WinSCP support fund.

Reply with quote

Advertisement

You can post new topics in this forum