Problem if LastWrite date is older than 12/14/1901
I'm having an odd problem and am finding it difficult to determine if the issue is WinSCP, the servers I'm connecting to, or perhaps the SFTP standard itself.
I have several thousand files I need to replicate where the LastWrite timestamp is 1/1/1601 (oldest possible NTFS timestamp).
I've tried various clients (WinSCP, FileZilla, Native Windows) and servers (Cerberus, Bitvise, Rebex tiny sFTP), and haven't found any combination that will allow for old remote timestamps to set and display properly.
This issue is causing thousands of files to re-sync (via
For a sanity check, to your knowledge, does the SFTP protocol permit setting and listing dates older than 1901 in the spec? If so, should WinSCP be able to set and understand such an old date if the server is sending such a timestamp properly in a directory listing?
Attached is a screenshot to hopefully better illustrate my point... you'll see that the files with timestamps pre 12/14/1901 locally differ wildly from their remote counterpart.
I have several thousand files I need to replicate where the LastWrite timestamp is 1/1/1601 (oldest possible NTFS timestamp).
I've tried various clients (WinSCP, FileZilla, Native Windows) and servers (Cerberus, Bitvise, Rebex tiny sFTP), and haven't found any combination that will allow for old remote timestamps to set and display properly.
This issue is causing thousands of files to re-sync (via
$session.SynchronizeDirectories
) whenever our script is re-ran because WinSCP interprets a 1/1/1601 timestamp as 4/22/2009.
For a sanity check, to your knowledge, does the SFTP protocol permit setting and listing dates older than 1901 in the spec? If so, should WinSCP be able to set and understand such an old date if the server is sending such a timestamp properly in a directory listing?
Attached is a screenshot to hopefully better illustrate my point... you'll see that the files with timestamps pre 12/14/1901 locally differ wildly from their remote counterpart.