MDTM (correction: MFMT) command - can't set proper time

Need help with FileZilla Server? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Post Reply
Message
Author
vtomoiaga
500 Command not understood
Posts: 4
Joined: 2008-03-18 12:00
First name: Vasile
Last name: Tomoiaga

MDTM (correction: MFMT) command - can't set proper time

#1 Post by vtomoiaga » 2008-03-18 12:55

Hello,

I connect programatically from a computer with a different time zone than the FileZilla server, and try to sync a local folder with a remote FTP folder (it's actually a backup from local to ftp).

Conditions:
Local time: UTF + 1;
FileZilla server local time: UTF + 2;
File asdf.txt resides on local machine and has timestamp 12:00:00

Actions:
I put file asdf.txt (programatically) then I call MDTM command to sync the timestamp on the FTP server.
After calling MDTM command, the uploaded file will have timestamp 14:00:00 (instead of 12:00:00).

Is it possible to know the FTP Server local time, to do a proper sync ? It seems that the FTP server will apply a timestamp different that what I wanted, namely: my timestamp + 2 (the difference from UTF).

Any ideas ?
Thanks.
Last edited by vtomoiaga on 2008-03-19 07:13, edited 1 time in total.

User avatar
boco
Contributor
Posts: 24118
Joined: 2006-05-01 03:28
Location: Germany

Re: MDTM command - can't set proper time

#2 Post by boco » 2008-03-18 16:19

First, which server software do you use? Because Filezilla Server does not support altering timestamps via MDTM, and never will. If you do not use Filezilla Server, I'll have to move your topic to 'General Discussion'.
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Do yourself a favor and read Network Configuration.
All FileZilla products fully support IPv6. http://worldipv6launch.org
### END SIGNATURE BLOCK ###

User avatar
botg
Site Admin
Posts: 31510
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: MDTM command - can't set proper time

#3 Post by botg » 2008-03-18 16:47

MDTM can only be used to get timestamps, never to set timestamps. The FTP specifications explicitly forbid it.

vtomoiaga
500 Command not understood
Posts: 4
Joined: 2008-03-18 12:00
First name: Vasile
Last name: Tomoiaga

Re: MDTM command - can't set proper time

#4 Post by vtomoiaga » 2008-03-19 07:13

Sorry. It's the MFMT command. I'm using FileZilla Server software. I will change the subject of the topic also.

User avatar
botg
Site Admin
Posts: 31510
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: MDTM (correction: MFMT) command - can't set proper time

#5 Post by botg » 2008-03-19 10:02

Since when is UTF a timezone? Last time I checked it was a character encoding, you surely mean UTC?

Timestamps used by MDTM, MFMT, MLST, MLSD and so on are required to be in UTC. Whereas the timezone used in the listings returned by LIST are unspecified. I think FileZilla Server uses local timezone for it.
File asdf.txt resides on local machine and has timestamp 12:00:00
Which would be 12:00+1 or 11:00Z.
After calling MFMT command, the uploaded file will have timestamp 14:00:00 (instead of 12:00:00).
Looks like you're calling MFMT with 12:00Z. Then in the listing returns 14:00+2 (which is 12:00Z).

If you would call MFMT with 11:00Z, listing would return the correct 13:00+2.

Subtract the differerence between your timezone and the server timezone (+1) and you're again at 12:00+1

vtomoiaga
500 Command not understood
Posts: 4
Joined: 2008-03-18 12:00
First name: Vasile
Last name: Tomoiaga

Re: MDTM (correction: MFMT) command - can't set proper time

#6 Post by vtomoiaga » 2008-03-19 11:24

Thanks. This is what I did manually to adjust the dates.

But is it possible to find (any) FTP Server Time Zone (programatically) ?

User avatar
botg
Site Admin
Posts: 31510
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: MDTM (correction: MFMT) command - can't set proper time

#7 Post by botg » 2008-03-19 12:50

Not directly. You can however calculate the difference between UTC and the timezone returned in the LIST data.

Take a file from the listing and look at it's time. Then do MDTM on that file. Compare both times and you got the server's LIST offset.

Alternatively just use MLSD to get the listings, it always is in UTC.

vtomoiaga
500 Command not understood
Posts: 4
Joined: 2008-03-18 12:00
First name: Vasile
Last name: Tomoiaga

Re: MDTM (correction: MFMT) command - can't set proper time

#8 Post by vtomoiaga » 2008-03-21 10:02

Ok, thank you very much.

Post Reply