Modified time from MLST vs MLSD

0 votes
asked May 14, 2012 by Dave Andersen (200 points)
edited Jun 11, 2012

In my tests I've noticed that when I do GetList(parentDir), the files all have FtpFile.Modified.Kind of DateTimeKind.Local.

But when I do GetFileDateTime(filePath), the returned file has FtpFile.Modified.Kind of DateTimeKind.Unspecified.

This answer explains why the kind property is Unspecified for GetFileDateTime, but I would have expected it to be consistent between the two calls. Is that by design, and can I expect the modified times from GetList to always use a Local DateTime? It's more important to me that the two times be consistent, rather than reflecting the correct timezone.

Applies to: Rebex FTP/SSL, Rebex Time

1 Answer

0 votes
answered May 15, 2012 by Lukas Pokorny (120,490 points)
edited Jun 11, 2012
Best answer

As of Rebex FTP/SSL 2012 R1, GetFileDateTime(filePath) method still uses MDTM command instead of MLST even on most servers which do support MLST/MLSD. But GetList(parentDir) does use MLSD when available. Check out the log created using Ftp object's LogWriter property to see what's actually going on.

We will change the default GetFileDateTime behavior for the next release to use MLST when available (and add an option to force the old behavior for those who depend on it).

Thanks for bringing this to our attention!

Update: Since Rebex FTP/SSL 2012 R2, GetFileDateTime uses MLST when available. Care has been taken to make the times returned by GetList and GetFileDateTime consistent, and this applies to SetFileDateTime as well.

commented Sep 8, 2015 by shacks (120 points)
What is required in code besides
to change the time to MLST
ftp.settings in does not exist.
commented Sep 8, 2015 by Tomas Knopp (58,890 points)
You seem to be on an older version of Rebex FTP component because the Ftp.Settings property was added in release 2012R1 ( no matter whether you use C# or VB.NET).

However, as written above, MLST command is used automatically since release 2012R2. You can login at and see what version you can actually download. If your support contract expired before 2012R2 was released (which was in June 2012), then you will need to update your support contract to be able to download the new version, which can be also done at page.

If you experience problem with the version 2012R2 or later, please create a log of communication as described and then either post it here or send to
commented Sep 8, 2015 by Tomas Knopp (58,890 points)
With version 2012R2 or later the ftp.GetFileDateTime(remotePath) method should automatically pick the MLST method if the server supports it. You do not need to modify the ftp.Settings.