Timezone (SITE ZONE) support

This forum is not monitored by the SmartFTP staff. If you have a license please contact technical support by email.
Post Reply
2BrightSparks
Posts: 44
Joined: Thu Feb 23, 2006 5:41 am

Timezone (SITE ZONE) support

Post by 2BrightSparks » Tue Mar 21, 2006 4:51 pm

Hi, is it possible to add a property that returns the FTP servers timezone, i.e. what's returned from SITE ZONE less the UTC prefix. The reason I ask is that some (annoying and non-compliant) FTP servers our customers have assume the date & time passed with MDTM is a local date & time and not UTC. In this case we need to know what timezone it's in so we can adjust it accordingly. Better yet, if you could add a new SetFileTime method, e.g. SetFileTimeEx, to take this automatically into account it would be great. We could do this manually, but I'm sure others would find such a feature very useful. At the moment the user needs to state that the FTP server is non-compliant as it's not possible to know (although if they support MLST/MLSD then they always return the date & times in UTC). Thanks.

mb
Posts: 12026
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Timezone (SITE ZONE) support

Post by mb » Wed Mar 22, 2006 5:59 am

Hello ..

What FTP server returns the the local time in the MDTM reply and supports the SIZE ZONE command? ServU? Version?

Regards,
SmartFTP

2BrightSparks
Posts: 44
Joined: Thu Feb 23, 2006 5:41 am

Re: Timezone (SITE ZONE) support

Post by 2BrightSparks » Wed Mar 22, 2006 7:05 am

Hi, one example is GlobalSCAPE Secure FTP Server. It is taking the value passed with MDTM as a local date & time (in its timezone), but it is returning it (in MLSD) as the value passed in MDTM. For example:

SYST
215 UNIX Type: L8
FEAT
211-Features supported:
COMB target;source_list
REST STREAM
SIZE
MDTM
XCRC filename;start;end
SSCN
MLST Size*;Modify*;Create;Type*;Unique;Perm*;Lang;Media-Type;CharSet;
211 END
MDTM 20060322063927 test1.txt
213 New file modification time is set: 20060322063927

The UTC date & time is passed via MDTM. But when it's read back from via MLSD it's returning the wrong value. Once converted to the local timezone it's off by 8 hours, which just happens to be the timezone the FTP server is in. So if I pass the MDTM 8 hours off in the other direction then it works (i.e. cancel out it's offset). The FTP server doesn't support SITE ZONE in this case but the user can manually say which zone the server is in in our client software (to get around problems like this).

Running exactly the same test (same files, same timezone) with Serv-U (and others, e.g. Raiden) there's no problem:

MDTM 20060322063927 test1.txt
253 Date/time changed okay.

MLSD returns the correct date & time.

2BrightSparks
Posts: 44
Joined: Thu Feb 23, 2006 5:41 am

Re: Timezone (SITE ZONE) support

Post by 2BrightSparks » Wed Mar 29, 2006 8:13 am

You may also find the following helpful:

http://www.indyproject.org/Sockets/Blog ... _15.en.iwp

It explains the SITE UTIME and MFMT extensions. Not sure if you use those or not, but with Indy (as he explains) if the FTP server supports MFMT then that is used instead of MDTM.

mb
Posts: 12026
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Timezone (SITE ZONE) support

Post by mb » Wed Mar 29, 2006 12:10 pm

Thanks. Nice article. But what server actually supports the MFMT feature?
Edit: The next version of the FTP Library will prefer MFTM instead of MDTM if available.

If there is a reliable way to detect gFTP and ncftp we can implement the SITE UTIME commands.

Edit: Pure FTP Server supports SITE UTIME as well:
http://freshmeat.net/projects/pure-ftpd ... _id=220345

Still the question remains how to detect the commands. Are they announced in the FEAT reply?

Regards,
-Mat
Last edited by mb on Wed Mar 29, 2006 3:55 pm, edited 1 time in total.

saku
Posts: 1
Joined: Thu Apr 06, 2006 8:32 am

Re: Timezone (SITE ZONE) support

Post by saku » Thu Apr 06, 2006 8:36 am


Post Reply