Troubles with FTP and modification time

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Kirara
New Member
New Member
Posts: 1
Joined: 2012-07-21, 16:54 UTC
Location: Prague, Czech Republic
Contact:

Troubles with FTP and modification time

Post by *Kirara »

When I upload file directly to FTP (keep date - on), then there is one hour less than on local filesystem. When I use synchronization, my local mtime is changed to one hour earlier. I can't find configuration which would work flawlessly. I'm from Czech Republic, locally I'm using CEST timezone. I don't know about FTP server, but I know it's supporting both MLSD and MDTM (so, IIRC it shouldn't modify my local mtime). The file which I am testing with is from 2012-01-06 (Y-M-D).
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

If you are sure about support of MLSD, you shoud tick the according option at TC settings for this connection (on advanced tab)
It is gray by default (means automatic detection), but why trusting a guess if you know it for sure?
#5767 Personal license
Sob
Power Member
Power Member
Posts: 941
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

You're right, there's something wrong. It only happens with NewTimeZoneMethod=1 (default on Win7).

Simple test:

Put two files on FTP server and manually set time for both to 02:50 UTC. Use winter date (without DST) for one and summer (with DST) for other:

MFMT 20120106025000 winter.txt -> will show as 03:50 in list -> correct (winter is UTC+1)
MFMT 20120706025000 summer.txt -> will show as 04:50 in list -> correct (summer is UTC+2)

Download the files to local disk -> times stay same -> correct.

Rename or delete the files on server and upload them again from local disk. These are commands used by TC to set their times:

MFMT 20120106015000 winter.txt -> will show as 02:50 in list -> wrong!
MFMT 20120706025000 summer.txt -> will show as 04:50 in list -> correct

Here it happens with both regular copying and synchronization.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48097
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately the FTP part knows nothing about NewTimeZoneMethod and uses the old method. I will try to add it, but cannot promise anything yet.
Author of Total Commander
https://www.ghisler.com
Sob
Power Member
Power Member
Posts: 941
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

FTP part knows enough to correctly display times depending on NewTimeZoneMethod. In the example above I set time for both files to 02:50 UTC and they correctly show as 03:50 and 04:50 local time with NewTimeZoneMethod=1. With NewTimeZoneMethod=0 they both show 04:50 (as currently I'm in UTC+2). So this part works correctly.

The only problem is with setting modification time for uploaded file. I read in some other thread that internally you have UTC timestamps for files and you only convert them to local time for display. In that case, there should not be any problem, MFMT also expects UTC, so just take your internal timestamp without any modifications.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48097
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Could you check in the log whether MFMT sends wrong UTC timestamp?
Author of Total Commander
https://www.ghisler.com
Sob
Power Member
Power Member
Posts: 941
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

It does, MFMTs at the end of the above example are the ones sent by TC.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48097
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, I will try to fix it.
Author of Total Commander
https://www.ghisler.com
Sob
Power Member
Power Member
Posts: 941
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

Seems to be fixed in 8.01rc5.

It works correctly with previously mentioned test. I even tried to switch computer's current time outside of DST to see if it perhaps makes any difference (I didn't really expect it would) and it doesn't.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48097
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks! Can anyone else confirm it?
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48097
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, since there were no objections, I will move this thread to fixed bugs.
Author of Total Commander
https://www.ghisler.com
Post Reply