MDTM (correction: MFMT) command - can't set proper time
Moderator: Project members
-
- 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
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.
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.
Re: MDTM command - can't set proper time
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'.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org
Re: MDTM command - can't set proper time
MDTM can only be used to get timestamps, never to set timestamps. The FTP specifications explicitly forbid it.
-
- 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
Sorry. It's the MFMT command. I'm using FileZilla Server software. I will change the subject of the topic also.
Re: MDTM (correction: MFMT) command - can't set proper time
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.
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
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.
Which would be 12:00+1 or 11:00Z.File asdf.txt resides on local machine and has timestamp 12:00:00
Looks like you're calling MFMT with 12:00Z. Then in the listing returns 14:00+2 (which is 12:00Z).After calling MFMT command, the uploaded file will have timestamp 14:00:00 (instead of 12:00:00).
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
-
- 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
Thanks. This is what I did manually to adjust the dates.
But is it possible to find (any) FTP Server Time Zone (programatically) ?
But is it possible to find (any) FTP Server Time Zone (programatically) ?
Re: MDTM (correction: MFMT) command - can't set proper time
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.
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.
-
- 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
Ok, thank you very much.