The SetScanDate script populates the ScanDate index field with the incorrect time


When using the SetScanDate custom code script, the date is correct but the time is several hours off. This is due to the fact that the document creation time is stored using Coordinated Universal Time (UTC), which is largely the same as Greenwich Mean Time (GMT) but does not observe Daylight Saving Time.


The SetScanDate custom code script uses the batch API function call TryGetDocumentCreatedDateTime which retrieves the creation date and time using the UTC time zone. However, users may want the current time displayed on their computer to be used to populate the ScanDate index field. This requires a simple change to the custom code script.

Follow these steps to modify the SetScanDate custom code script:

  1. If you want to modify this script for just one job, open up Job Properties for that job and open up the Script Editor for where ever you imported the SetScanDate script.
  2. Go to line 48 and replace:
    if (!this.Batch.TrySetIndexValue(id, “Scan”Date”, documentCreatedDate, true, out error))


    if (!this.Batch.TrySetIndexValue(id, “Scan”Date”, documentCreatedDate.ToLocalTime(), true, out error))

    The script will now convert the document created time from UTC to your automation server's local time zone.

Note: By design, Capture utilizes UTC time to ensure all timestamps are normalized. When using Capture in a distributed scanning environment that could span multiple time zones, using the above code change to localize the timestamps could become confusing to users.


Filed under PaperVision® Capture, R70.6

Last modified Feb 24, 2020

Submitted Apr 13, 2010

Related Articles

Share via Email Print