Topic "Problem with handling of Windows setting re Auto Adjust DST"

Author Message
jplumbley
[View user's profile]

Joined: 2005-07-15
Posts: 3
Hello,
I have what I think is a problem with the timestamp that WinSCP shows for remote files. The problem disappears if I turn off the windows date and time properties setting "Automatically adjust clock for daylight saving changes".
Details are:
winscp 3.7.4 (running on on winxp with sp2)
with setting "Server works in UTC time (adjust DST locally)"
with interface "Norton Commander"
Protocol is SFTP(v3)
The server is Linux running openSSH
My PC's timezone is set to 'GMT London' and currently DST is in force.
If I set my PC's date and time setting to "Automatically adjust clock for daylight saving changes" then the datestamp shown for remote files (and local files) are all correct.
When I uncheck the setting "Automatically adjust clock for daylight saving changes" then the timestamp of...
i) a recent remote file - increases by +2 <<<<<< I THINK THIS SHOULD BE +1
ii) a 6 month old remote file - increases by +1 (as expected)
iii) a recent local file - increases by +1 (as expected)
iv) a 6 month old local file - increases by +1 (as expected)
In other words it is as though WinSCP is adjusting the timestamp of all files by +1 and then an extra erroneous +1 for remote files whose timestamp falls within a DST period.

n.b. None of the above remote files were transferred by WinSCP, they were existing remote files whose details were being viewed.
n.b. There is no problem when viewing the details of the same remote files using Filezilla using SFTP.

Thanks,
John.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
I'll check it. Thanks for info.
_________________
Martin Prikryl
jplumbley
[View user's profile]

Joined: 2005-07-15
Posts: 3
oops, I meant to say...
...If I don't set my PC's date and time setting to "Automatically adjust clock for daylight saving changes" then the datestamp shown for remote files (and local files) are all correct.
When I enable the setting "Automatically adjust clock for daylight saving changes" then the timestamp of...
Guest




Hi,

This still apears to be a problem in the latest version of WinSCP.
Is there any further info that I could supply which would be helpful to you?

Regards
John.
AG

Guest


I am experiencing a similar problem which might have the same root: WinSCP displays remote modification time 1 hour ahead of what ls reports. This is not affected by WinSCP Environment DST setting. My WinXP DST is always on and I live in GMT+5
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Quote:
This still apears to be a problem in the latest version of WinSCP.
Is there any further info that I could supply which would be helpful to you?

Sorry, I haven't time to try to investigate the problem before the last release. It's still on the TODO list though.
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
AG wrote:
I am experiencing a similar problem which might have the same root: WinSCP displays remote modification time 1 hour ahead of what ls reports. This is not affected by WinSCP Environment DST setting. My WinXP DST is always on and I live in GMT+5

Have you read the documentation? Does it help?
_________________
Martin Prikryl
AG

Guest


prikryl wrote:
AG wrote:
I am experiencing a similar problem which might have the same root: WinSCP displays remote modification time 1 hour ahead of what ls reports. This is not affected by WinSCP Environment DST setting. My WinXP DST is always on and I live in GMT+5

Have you read the documentation? Does it help?


Yes, that actually helps, thanks!
jplumbley
[View user's profile]

Joined: 2005-07-15
Posts: 3
prikryl wrote:
Quote:
This still apears to be a problem in the latest version of WinSCP.
Is there any further info that I could supply which would be helpful to you?

Sorry, I haven't time to try to investigate the problem before the last release. It's still on the TODO list though.

I've done some further tests myself and also read some of the WinSCP source code. In particular the routines UnixToDateTime, DateTimeToFileTime and ConvertTimestampToUnix. For example in the UnixToDateTime routine I can see it subtracts Params->CurrentDifference (which may include the DaylightDifference) but then goes on (if ConsiderDST is set) to maybe subtract the DaylightDifference again. I think this is what is causing my problem.

I have now come to the conclusion that I should configure WinSCP with "Server Adjusts DST" even though my server is unix. This then looks as though it will solve my problem (both now and after the imminent DST change). However this would then mean I would have this option configured in the opposite way to what the documentation indicates is needed for a unix server:
Quote:
Some servers (mostly on Windows) adjust file timestamp with start of DST and some not (Unix). The option selects between the two approaches

It looks as though (with SFTP) the code is implementing this option back to front.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
jplumbley wrote:
I've done some further tests myself and also read some of the WinSCP source code. In particular the routines UnixToDateTime, DateTimeToFileTime and ConvertTimestampToUnix. For example in the UnixToDateTime routine I can see it subtracts Params->CurrentDifference (which may include the DaylightDifference) but then goes on (if ConsiderDST is set) to maybe subtract the DaylightDifference again. I think this is what is causing my problem.

Thanks for your analysis. I'll check it.
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
I've spent some time trying to find a solution. Unfortunatelly I was not successful.

What I've learned:
Currently DST is on, my timezone is CET (GMT+1). "Auto adjust DST" is on in Windows. In this situation I need to adjust remote UTC timestamp of file created out-of-DST by 3 hours to display the same time the Windows Explorer would. I know this from experience, I cannot explain it. Common sense would suggest 2 hours (1 for timezone, 1 for DST). However Windows treats timestamp in some strange way of its own. Particularly it shifts timestamp by 2 hours for DST. You have noticed that I subtract DaylightDifference twice. This is actually hack to achieve the 3 hours difference. This proved to work (until now).

If I switch off the "Auto adjust DST", Windows Explorer decreases timestamp by one hour. However in the situation DaylightDifference is zero, making WinSCP shift the timestamp by 1 hour, instead of correct 2. I do not know how to achieve the correct behaviour.

So I believe that problem is not that I subtract DaylightDifference twice as it is zero anyway.
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
I have tried to summarize and explain current WinSCP behaviour in documentation. For feedback please follow to this topic.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License