"Last modified" time being set to 1970

Advertisement

ddcohen
Joined:
Posts:
1

"Last modified" time being set to 1970

I'm using the WinSCP .NET component to transfer files from a Windows machine (where their "last modified" time is displayed correctly) to a remote server. The "last modified" time is showing up on the server as March 2, 1970. This happens regardless of whether TransferOptions.PreserveTimestamp is set to true or false. When I use a different SFTP client to transfer the files, the "last modified" time shows up correctly on the server.

I understand that according to the SFTP specs (https://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#page-21), the "mtime" field is supposed to be expressed in "Unix time." It seems that the WinSCP .NET component is not correctly converting the NTFS timestamp into this format. It may just be grabbing certain bits directly from the NTPS timestamp and populating the "mtime" field with that, and the server on the receiving end is then interpreting this timestamp (as it should!) as a number of seconds since the Unix epoch.

Any insight or suggestions for a workaround would be greatly appreciated.

-- David

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: "Last modified" time being set to 1970

WinSCP obviously does that.
Do you see the problem also when using WinSCP GUI?
Please set Session.SessionLogPath and attach the log.
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum