Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get file modify date in C# [duplicate]

Tags:

c#

file

How do I read the modify date of the file in C#?

I can read the creation date of the file by using the code below:

ModifyDate = File.GetCreationTime(FilePath)
like image 928
sanchop22 Avatar asked May 08 '12 11:05

sanchop22


People also ask

How do I find file creation and modification date time in Linux?

Getting the File Creation Date Using debugfs We can also use the debugfs command to find the creation date on ext4 filesystems. However, it is not as intuitive as the stat command since its primary purpose is to debug filesystems. Firstly, we need the inode number of our file. We can find it with the ls command.


2 Answers

File.GetLastWriteTime will do the job

like image 122
Filippo Pensalfini Avatar answered Oct 12 '22 23:10

Filippo Pensalfini


I believe you're looking for GetLastWriteTime

like image 33
Kris Avatar answered Oct 13 '22 00:10

Kris