Page 1 of 1

Get modification date for a job file

Posted: Fri Feb 15, 2019 2:44 am
by billy.olvestad
I need to get the modified date from windows for files, but I can't find a function that will do that.

I can get the creation date with "Job.FileCreationDate", but I need the equivalent for the modified date.

I have tried "Doc.Modified" but that doesn't take the date from the file info in Windows it seems, so the date can be off a number of days.

Is there a way to get the modified date? I can see the column in the switch file info window but it seems impossible to use that date.
Maybe I need to create a script, but how do I get that date in as switch script then?

Re: Get modification date for a job file

Posted: Fri Feb 15, 2019 9:12 am
by freddyp
I logged it as a feature request, but with this code snippet you can add the modification date to the job's private data:

Code: Select all

var modDate = new File( job.getPath()).lastModified;
job.setPrivateData( "ModificationDate", modDate);

Re: Get modification date for a job file

Posted: Fri Feb 15, 2019 9:42 am
by billy.olvestad
freddyp wrote: Fri Feb 15, 2019 9:12 am I logged it as a feature request, but with this code snippet you can add the modification date to the job's private data:

Code: Select all

var modDate = new File( job.getPath()).lastModified;
job.setPrivateData( "ModificationDate", modDate);
Oh my god, that was simple :D
Thank you very much. You saved my day!
It works like a charm.