Creationtime of the file

I’m using this formula to find the creation date of one file:

new FileInfo(“filepath”).CreationTime.ToString(“dd/MM/yyyy”, culture) where culture= new cultureinfo(“nl-BE”)

BUT the output I am getting is creation date: “01/01/1601” where creation date is of type string.

how can I get the exact creation date of the file?

As seen here, it doesn’t always return accurate value. Try using an invoke method activity, with method name Refresh and target object new FileInfo(“filepath”) and TargetType null.
Good luck.

you mean after invoking the method, shall I use “new FileInfo(“filepath”).CreationTime.ToString(“dd/MM/yyyy”, culture) where culture= new cultureinfo(“nl-BE”)”

Something like this ( in the opened window is the text in write line).

2 Likes

i Had tried this. But its again displaying 01/01/1601

You are getting that date because your Filepath does not exist. Make sure you are putting in the correct filepath into that line of code. You might also want to check that the file exists beforehand with the File Exists activity or using code like File.Exists(filepath)

Regards.

3 Likes

yup my filepath was not passing correctly. Now I got It thanks!!!

Thanks!!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.