Get modification date for a job file

Post Reply
User avatar
billy.olvestad
Member
Posts: 51
Joined: Mon Nov 19, 2018 10:08 pm
Location: Sweden
Contact:

Get modification date for a job file

Post 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?
freddyp
Advanced member
Posts: 1008
Joined: Thu Feb 09, 2012 3:53 pm

Re: Get modification date for a job file

Post 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);
User avatar
billy.olvestad
Member
Posts: 51
Joined: Mon Nov 19, 2018 10:08 pm
Location: Sweden
Contact:

Re: Get modification date for a job file

Post 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.
Post Reply