Accurate Date/Time with Timezone when Downloading Files from FTP?
Can you please confirm when downloading file(s) from FTP using Chilkat component, the date/time stamp of the file (creation/modified date) is communicated after download?
For example, a PC where the file is being downloaded is at EST while the server where the file was located is on PST timezone. Server time for example, was 4:00 AM, while PC where file is being downloaded is at 2:00 AM. Which date we will get in the “creationDate” property of FileInfoType object? Server date(4:00 AM) or client date (2:00 AM)
If that is still giving server date, is there any way to detect server timezone or if there is a way to convert the date to local date?
This is a good question, and the answer depends on the capabilities (make/model) of the FTP server. If the FTP server supports the MLSD command then Chilkat will automatically know and use the MLSD command to fetch directory listings, and the date/times are provided with timezone information. Chilkat will download and save the local file with the correct date/time. If the client-side is EST, and the server is PST, then the adjustment is made.
Many FTP servers are older and do not support MLSD. In these cases, the server only supports the “LIST” command which provides directory listings in human-readable format, and the listing formats can vary greatly, and the information available can vary greatly. For example, it may be that for files older than a certain limit, that hour/minute/second information is not provided. Certainly timezone information is not provided. In this case, Chilkat assumes that the timezone of the server is the same as the client. (There is no way to know the timezone of the server.)