tags:

views:

12

answers:

1

I have a number of files in a folder, I need to get the last modified date. So I used

FDate = IO.File.GetLastWriteTime(FName)

Works fine with some files, but on others, I get a date of 1/1/1601. But when I check the files in Windows Explorer, all the dates look normal (recent). So, I'm gessing there are multiple files dates stored in the file system, and the ones dotnet is seeing are not the ones windows is seeing. How can I get exactly the date which appears as "date modified" in a file explorer window? I tried some vb6 api stuff but that doesn't seem to work in dotnet.

Thanks

A: 

From File.GetLastWriteTime Method:

If the file described in the path parameter does not exist, this method returns 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC), adjusted to local time.

The file you are querying is probably missing.

Martin Liversage
I can't believe it, you right, it isn't!! But it was earlier!! Something else wierd is happening. Funny how when you get stuck in a problem you can sometimes miss the obvious. Cheers
Ianb