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

Description


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 the same as Greenwich Mean Time (GMT).

Summary


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))

with:

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 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 Apr 13, 2010

Submitted Apr 13, 2010

Related Articles

Share via Email Print