robinrodricks / FluentFTP

An FTP and FTPS client for .NET & .NET Standard, optimized for speed. Provides extensive FTP commands, File uploads/downloads, SSL/TLS connections, Automatic directory listing parsing, File hashing/checksums, File permissions/CHMOD, FTP proxies, FXP support, UTF-8 support, Async/await support, Powershell support and more. Written entirely in C#.
MIT License
3.14k stars 657 forks source link

FtpListItem.Modified is incorrect #1669

Closed RobinHSanner closed 2 weeks ago

RobinHSanner commented 1 month ago

FTP Server OS: Unknown

FTP Server Type: Unknown

Client Computer OS: Windows

FluentFTP Version: 51.1.0

Framework: .NET 8

FtpListItem.Modified is a DateTime with Kind of Unspecified. It actually contains the local time on the ftp server. It should be a DateTimeOffset or a DateTime with Kind of UTC. Also Created is set to DateTime.MinValue.

Logs :


<paste VERBOSE logs here>
FanDjango commented 3 weeks ago

FTP Server OS: Unknown

FTP Server Type: Unknown

Actually, this is server-specific. There is no standardised (RFC) way to determine the FTP server's time zone, as well as what time zone the time stamps supplied in a LIST response belong to. At least for the response to a MLST command you can (relatively) safely assume the times are UTC.

It actually contains the local time on the ftp server

On the servers you are accessing, perhaps.

Also Created is set to DateTime.MinValue

If you are using the LIST command, you typically only get Modified. MLST might give you more. **But note that the server will tell you in a FEAT response exactly what format and what values it will report as response to an MLST - Created might very well be omitted.


So no, I think DateKind.Unspecified is probably the healthy way to do this.