Changing the TimeZone of IPTC:TimeCreated

Started by mike_walker, August 26, 2021, 09:24:08 AM

Previous topic - Next topic

mike_walker

Hi - apologies if I've missed this but before I get into something more complicated I thought I'd check...

Background: I get a lot of photos sent to my via WhatsApp which I want to, correctly date/time stamped, keep in my local collection (via Picasa) and also in Google Photos.  Since it appears that WhatsApp strips all of this information out of the photo my workflow is to place the picture in around the right place in Picasa and then assign it a Date/Time with that program's "Adjust Date/Time" function.  This works fine until I upload to Google Photos and the TimeZone information in "IPTC:TimeCreated" isn't right if it's British summer Time (ie +01:00) as it defaults to 00:00.  FYI I know there is a fair bit of debate around the fields that Google Photos uses but, for me, getting "IPTC:TimeCreated" right does it for me.

So - is it possible to just amend the TimeZone element of IPTC:TimeCreated whilst maintaining the existing Time component? ie change 17:32:00+00:00 to 17:32:00+01:00? and apply this to a whole directory?

If not then what would be a good way to do this - copy the time to the filename, edit the name there and then copy it back (seems a bit amateur!!).

StarGeek

Quote from: mike_walker on August 26, 2021, 09:24:08 AMFYI I know there is a fair bit of debate around the fields that Google Photos uses but, for me, getting "IPTC:TimeCreated" right does it for me.

I've never seen any debate and I've listed the 12 tags for images that Google photos uses as the time stamp on these forums several times.  Google will read time zones from any tag that can include a time zone, but if you add GPS coordinates, Google uses the time zone for that location over everything else.

QuoteSo - is it possible to just amend the TimeZone element of IPTC:TimeCreated whilst maintaining the existing Time component? ie change 17:32:00+00:00 to 17:32:00+01:00? and apply this to a whole directory?

Try
exiftool "-TimeCreated<${TimeCreated;s/\+00:00/+01:00/}" /path/to/files/
This does a regex substitution on the +00:00 of the tag and then copies the new value back into the file.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

mike_walker

You're amazing, thanks.  That has done the trick! I owe you a pint! ;D