0 votes

When calling ftp.GetFileModificationTime(filename) the last modified date/time is returned. I'm using this against an IIS 7.5 server.

I notice the date returned appears to be local time (Eastern Standard in my case) rather than UTC. I have verified that the FTP server is actually returning a UTC time from the MDTM call using WSFTP's QUOTE call EG: MDTM filename.txt

Does FTP.dll convert the UTC date time returned by the FTP server to local system time rather than returning the raw UTC time returned by the server? This would explain why I'm seeing this in EST rather than UTC. I can easily convert back to UTC, but want to verify what time zone FTP.dll is actually returning when calling GetFileModificationTime.

by

1 Answer

0 votes

All .NET DateTimes are usually converted to local time. Use DateTime.ToUniversalTime() method to obtain UTC value.

by (297k points)
...