Error to get file last write time

I am trying to get latest write time. Below is my query

DateTime.ParseExact(System.IO.File.GetLastWriteTime(filepath).ToString,“MM/dd/yyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy HH:mm:ss”)

However, I got this error!
Expression Activity type ‘VisualBasicValue`1’ requires compilation in order to run. Please ensure that the workflow has been compiled.

When I debug and tested the output on Immediate, it works well.

Hi @aqiffm

Retype the double quotes or else copy the below syntax:

DateTime.ParseExact(System.IO.File.GetLastWriteTime(filepath).ToString,"MM/dd/yyyy HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy HH:mm:ss")

this solved it. thankss

1 Like

You’re welcome @aqiffm

Happy Automation!!

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