Using File.SetCreationTime and File.SetLastWriteTime makes Windows Explorer hide these details for the file

Viewed 107

I encountered something weird while trying to set CreationTime and LastWriteTime on a file.

DateTime nDT = new DateTime(1974, 12, 23,10,31,34);
string path = @"C:\Users\matte\Desktop\Desktop_Test.zip";
File.SetCreationTime(path, nDT);
File.SetLastWriteTime(path, nDT);

I'm using this code in a console app and when it runs, it updates those properties but the related values disappear from Windows Explorer.

File with new CreatonTime and LastWriteTime

Did I make any mistake?

1 Answers
Related