Getting the Modified Time Stamp from a File in .Net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I get the File Time Stamp that appears in the Modified Column in Windows Explorer

I've tried the different methonds of the File class (GetCreationTime, etc.) and they sometimes return values different than the one that appears on Windows Explorer.

Thanks in advance!
 
Hi Dan , the LastWriteTime method seems to give consistent results for
modified . Acc ot docs you might face a prob wit Win95/98/me

Manasvin





Dan said:
How do I get the File Time Stamp that appears in the Modified Column in Windows Explorer?

I've tried the different methonds of the File class (GetCreationTime,
etc.) and they sometimes return values different than the one that appears
on Windows Explorer.
 
Try moving the file(s) around (days after in my environment), the time stamp in WinExplorer will not change but both, the File.GetLastWriteTime method and the FileInfo.LastWriteTime property will report values that are different from the one that WinExplorer shows. That's why I have this problem.

----- (e-mail address removed) wrote: -----

Hi Dan , the LastWriteTime method seems to give consistent results for
modified . Acc ot docs you might face a prob wit Win95/98/me

Manasvin





Dan said:
How do I get the File Time Stamp that appears in the Modified Column in Windows Explorer?
etc.) and they sometimes return values different than the one that appears
on Windows Explorer.
 
Hi Dan,

tried moving it. changed four directories. Still gettting the same result.
using .NET 1.1. anything else I cna try to simulate the problem ?

Manasvin

Dan said:
Try moving the file(s) around (days after in my environment), the time
stamp in WinExplorer will not change but both, the File.GetLastWriteTime
method and the FileInfo.LastWriteTime property will report values that are
different from the one that WinExplorer shows. That's why I have this
problem.
 
I've been running some tests and it looks like it may have something to do with Daylight time. I'm looking at a file from last June @ 11:30 PM and the date/time returned by FileInfo.LastWriteTime is one hour later, which changes the date. I don't know if this is by design since the also have lastWriteTimeUtc property

Thanks for the help
 
I'm using W2k and .NET 1.1 as well.

----- (e-mail address removed) wrote: ----

Hi Dan

tried moving it. changed four directories. Still gettting the same result
using .NET 1.1. anything else I cna try to simulate the problem

Manasvi

Dan said:
Try moving the file(s) around (days after in my environment), the tim
stamp in WinExplorer will not change but both, the File.GetLastWriteTim
method and the FileInfo.LastWriteTime property will report values that ar
different from the one that WinExplorer shows. That's why I have thi
problem
 
Back
Top