Skip to main content
Damon D Bell
Known Participant
December 13, 2019
Question

Any way to overwrite Date Modified with Date Taken metadata with a PS script?

  • December 13, 2019
  • 2 replies
  • 2711 views

Anyone know if it is possible to get the Date Taken metadata from a file and write that timestamp into the Date Created meta data? Preferrebaly, this would be done without opening the file in Photoshop and also done directly through a PS script.

I have a batch automation script that processes files and saves new modified copies of each image. Some users need the Date Created data to be the date/time the photo was taken in order to match times to barcode scanner data in another software. When a new image copy is saved, the OS creates a new Date Created timestamp. Preferrably, I'd like to have the script just update the Date Created meta data to match the Date Taken meta data after the image is saved without reopening the file. Not sure if this is possible or not.

This topic has been closed for replies.

2 replies

Legend
December 19, 2019

It could also be done in Bridge pretty easily. You can watch a folder and auto-process files as they come in.

Stephen Marsh
Community Expert
Community Expert
December 14, 2019

I'm guessing that ExifTool is probably going to be the best answer. There are many metadata date fields, some may depend on the file format.

 

I just resaved a PSD from 2018 and the following "original" fields were shown:

 

[IPTC] DateCreated : 2018:01:18
[XMP-xmp] CreateDate : 2018:01:18 11:48:11
[XMP-photoshop] DateCreated : 2018:01:18 11:48:11.923
[ExifIFD] DateTimeOriginal : 2018:01:18 11:48:11
[ExifIFD] CreateDate : 2018:01:18 11:48:11

 

While an edited file may contain extra date info, such as:

 

[IFD0] ModifyDate : 2019:12:15 10:20:57
[XMP-xmp] ModifyDate : 2019:12:15 10:20:57+11:00
[XMP-xmp] MetadataDate : 2019:12:15 10:20:57+11:00

 

So you'll need to decide to only update the specific fields that you require, or update and remove any conflicting fields that you may not be directly concerned with.

 

There are some date/time related examples here:

 

https://exiftool.org/exiftool_pod.html#WRITING-EXAMPLES

 

And you can also search the ExifTool Forum for more:

 

https://exiftool.org/forum/

 

Good luck!