You can work out the time offset by exploiting an idiosyncrasy of the protocol. The GetLastWriteTime, which uses the MDTM command, returns the time in UTC, whereas the GetFileInfos() method returns timestamps in the local time. What you can therefore do is retrieve a directory listing using GetFileInfos() and then call GetLastWriteTime() for one of the files or directories in the listing. Then timezone offset is the difference between the two.
Please let me know how that goes.
- Hans (EnterpriseDT)
:? Ok...
What I want is the timestamp on the client file to be the same as the timestamp on the server file ignoring any timezone differences. As mentioned above, although maybe not clearly, it WAS working! I was using the timestamp from the FTPFile class returned by the GetFileInfos command and assigning it the client file timestamp.
This was working when I was testing in December. However, when I went to check with one of our user's, the timestamps of the files on the client machine weren't the timestamps from the server anymore, they were the timestamps with the difference between the server timezone and the client timezone applied.
When I looked at the FTPFile timestamp, it now showed the "Kind" as UTC where previously it showed as "Unspecified".
I'll look but I don't think I changed any code that would cause this. So I was thinking it was something in the latest edtFTPnetPRO.dll, 8.3.20 that I updated to in my project about the same time...