Topic "File Sync Daylight Savings Issue"

Author Message


I recently set up a sync using the .Net libraries. I'm syncing from/to Windows Server 2008r2. Both are set to US Central Time with Daylight Savings enabled. I'm using Bitvise SSH Server, (winsshd), on the remote server. The sync works fine, but for some reason the modified stamps are an hour earlier on the remote server. I tried opening WinSCP, setting it to "adjust remote timestamp with DST" and saving as default which updated my .ini file. I also tried sessionOptions.AddRawSettings("ConsiderDST","1") in my .Net code.(found this google hit: <invalid link removed by admin>) To test these, I deleted a file from the remote server and ran the sync. In both cases the file I deleted was recreated with a modified date that was still off by an hour. Any ideas what would be going on here? From the documentation it seems like 2008r2 shouldn't be affected, but it's hard to tell. Here's the code if it helps:

SessionOptions sessionOptions = new SessionOptions
    Protocol = Protocol.Sftp,
    HostName = context.MergedJobDataMap.GetString("HostName"),
    PortNumber = context.MergedJobDataMap.GetInt("PortNumber"),
    UserName = context.MergedJobDataMap.GetString("UserName"),
    //Password = context.MergedJobDataMap.GetString("Password"),
    SshPrivateKeyPath = context.MergedJobDataMap.GetString("PrivateKeyPath"),
    SshHostKeyFingerprint = context.MergedJobDataMap.GetString("SshHostKeyFingerprint")

using (Session session = new Session())
    // Will continuously report progress of synchronization
    session.FileTransferred += delegate(object sender, TransferEventArgs e){
        if(e.Removal != null && e.Removal.FileName != null)
            Log.Info("Removing file: "+e.Removal.FileName);
        Log.Info("File transferred: "+e.FileName);


    SynchronizationResult synchronizationResult;
    synchronizationResult =
            (SynchronizationMode)Enum.Parse(typeof(SynchronizationMode), context.MergedJobDataMap.GetString("SynchronizationMode")),

    // Throw exception on any error

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27059
Location: Prague, Czechia
Where do you observe a shifted timestamp? In WinSCP listing on remote panel? In Windows Explorer? Or both? Please attach a full log file showing upload of a single file. Please indicate timestamp you expect the file should have a timestamp you actually see.
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