Topic ""Last modified" time being set to 1970"

Author Message
[View user's profile]

Joined: 2012-07-23
Posts: 1
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 (, 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
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26858
Location: Prague, Czechia
WinSCP obviously does that.
Do you see the problem also when using WinSCP GUI?
Please set Session.SessionLogPath and attach the log.
Martin Prikryl

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License