Get file creation date

Hi all,

I’m trying to get the file creation date. But no idea how to to do so.

Can anyone share some ideas regarding to this. Many thx

I actually get the file date via new FileInfo(“filepath”).CreationTime.ToString(“dd/MM/yyyy”)
But I wanna get time as well. Can I know how to modify the above code and I can get date and time together. thx

1 Like

FileInfo(“filepath”).CreationTime.ToString(“dd/MM/yyyy hh:mm:ss”)

For 12 hour format, it is hh:mm:ss
For 24 hour format, it is HH:mm:ss

2 Likes

Also u can get last update time with this Directory.GetLastWriteTime(“path”).ToString(“dd.MM.yyyy-HH.mm.ss”)

1 Like

This worked for me and the similar task I had. Thanks

1 Like