File creation DateTime changes?

I have an application for updating the client files. This app reads the files from the server and compares the file creation DataTime with the files in the client machine if there is a change then it downloads the new file. The problem is when you copy the file to the client machine, it's creation datetime changes to a random date. Which parameter can I rely on if the creation datetime and the last write date of file always changes

Thanks for your help



Answer this question

File creation DateTime changes?

  • BShaw

    Why, incase of different time zones you shouldn't take about the date and time, consider it as a time stamp!

    You should follow server date and time.

    Try SetCreationTimeUtc, GetLastAccessTimeUtc instead!

    Hope this can help!

    Best regards,

    Amr Ouf



  • Michelle S

    It didn't work and here what I get,

    On the client side CreationDate 12/11/2006 On the server side 10/23/2006

    the dates are so far apart. Thanks Amr I appreciate your help. I am still looking for an answer before turning on the file versioning.


  • Marisa Seal

    Thanks Amr,

    But I used that for both the last write datetime and the creation datetime but it didn't work when the client and the server are in a different time zone. Are there any parameters that don't change when you copy the file except the file name and its version

    Thanks

    Ala


  • cichanlx

    What do you mean by considering it as a time stamp

    I will try those function and let you know.

    Thanks alot

    Ala


  • Josh Robertson

    Dear Ala,

    I don't find any parameters to copy with the same date and time.

    But you can use System.IO.File.SetCreationTime() to set file creation date and time after copy with the server file date and time.

    System.IO.File.SetCreationTime(clinetfile, System.IO.File.GetCreationTime(serverfile))

    Hope i could answer your question,

    Best regards,

    Amr Ouf



  • File creation DateTime changes?