Author Topic: Question about the Date Parameter  (Read 6385 times)

0 Members and 1 Guest are viewing this topic.

Padanges

  • Newbie
  • *
  • Posts: 179
Question about the Date Parameter
« on: August 19, 2016, 11:05:09 AM »
Hi,
in Eval expressions "CD" stands for Creation date, "MD" stands for Modification date, and "FD" stands for File date, but what exactly is the file date? Is it file access date? Is it file DB entry creation date? I need to have a separate entry for: file last Access Date, file DB Entry Creation Date, and file DB Entry Modification (for example, after Info Field edit) Date. Is there a way to get any of those parameters?


Thanks in advance

RTT

  • Administrator
  • *****
  • Posts: 918
Re: Question about the Date Parameter
« Reply #1 on: August 20, 2016, 02:56:39 AM »
The PDFE file date field holds the file system file date modified property. The creation date and modification date fields are related to the PDFs internal metadata  properties.

Padanges

  • Newbie
  • *
  • Posts: 179
Re: Question about the Date Parameter
« Reply #2 on: August 22, 2016, 12:43:31 PM »
Is there a way to get file last Access Date, file DB (PDFe Entry) Creation Date, and file DB (PDFe Entry) Modification Date?

RTT

  • Administrator
  • *****
  • Posts: 918
Re: Question about the Date Parameter
« Reply #3 on: August 23, 2016, 02:35:36 AM »
The modification date is already indexed in the DB (due to a bug in latest release, it is showing in GMT instead of local time), as it is used internally to know if the file needs to be reindexed.
The last accessed and creation dates are not currently indexed in the DB, and will not be until major DB code changes introduced. But these are file system properties, so, as workaround, you can use a script to fill custom fields with these.

Padanges

  • Newbie
  • *
  • Posts: 179
Re: Question about the Date Parameter
« Reply #4 on: August 23, 2016, 06:53:28 AM »
Ok, then the file last Access Date should be something like this "return BatchFile.DateLastAccessed;" for the script, but it is not. Nor I was able to find any other expressions among sample scripts. Could you help with this?

RTT

  • Administrator
  • *****
  • Posts: 918
Re: Question about the Date Parameter
« Reply #5 on: August 24, 2016, 12:10:55 AM »
Check the DateLastAccessed property of the FileSystemObject

Code: [Select]
function DateLastAccessed() {
    var fso, f;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    f = fso.GetFile(BatchFile.Filename);
    return f.DateLastModified;
}

Padanges

  • Newbie
  • *
  • Posts: 179
Re: Question about the Date Parameter
« Reply #6 on: August 25, 2016, 11:36:56 AM »
Thanks. The code works fine. Though, operating systems handle time stamping differently depending on the file system in use, therefore it's tricky to "audit" Access Date properly.

RTT

  • Administrator
  • *****
  • Posts: 918
Re: Question about the Date Parameter
« Reply #7 on: August 26, 2016, 01:45:53 AM »
If you know the file system, you may take these differences into account.
https://msdn.microsoft.com/en-us/library/ch28h2s7(v=VS.85).aspx