Good day!
I'm trying to get the Modified Time Stamp (that appears in Windows
Explorer).
You should be able to use the System.IO.FileInfo.LastWriteTime (or
LastWriteTimeUtc) property to read the same date/time value that Windows
Explorer shows in its "Date Modified" column. The other date/time properties
published are CreationTime and LastAccessTime, equivalents of which can be
seen in Windows Explorer when you open properties of any file.
But, in this case, if I've moved the file, it returns other date than
Windows Explorer.
When moving or copying files, the LastWriteTime property should stay the
same, and I cannot think of a situation immediately where this wouldn't be
the case.
However, different file systems store dates and times with a different
precision. For example, the FAT and NTFS file systems are different, as
could be file systems on network file servers. Also note that if you are
accessing a file from a network drive, the last modified time of the file
usually comes from the server. So if the clocks on the server and your PC
are out of sync, then you could see different times.
But then again, FileInfo.LastWriteTime should always be the same as what
Windows Explorer reports.
--
Regards,
Mr. Jani Järvinen
C# MVP
Helsinki, Finland
(e-mail address removed)
http://www.saunalahti.fi/janij/