Time Zone Problems ... once again

Started by Hans Kraus, July 14, 2022, 09:53:19 AM

Previous topic - Next topic

Hans Kraus

Hi,
I was on holyday in Brazil, IguazĂș (time zone Sao Paulo, GMT -3).
Returnig home (Vienna, time zone MEST, GMT +2, daylight savings time on) I took some pics without setting the correct time zone. exiftool returns:

File Modification Date/Time     : 2022:07:13 09:57:16+02:00
File Access Date/Time           : 2022:07:14 15:35:25+02:00
File Creation Date/Time         : 2022:07:13 09:57:12+02:00
:
:
Date/Time Original              : 2022:07:13 09:57:12
Offset Time                     : -03:00
Offset Time Original            : -03:00
Offset Time Digitized           : -03:00
:
:
Time Zone                       : -03:00
Time Zone City                  : Sao Paulo
Daylight Savings                : Off
:
:
Time Stamp                      : 2022:07:13 09:57:12.23
:
:
Create Date                     : 2022:07:13 09:57:12.23-03:00
Date/Time Original              : 2022:07:13 09:57:12.23-03:00
Modify Date                     : 2022:07:13 09:57:12.23-03:00

After reading through the forum's time zone info I tried:

exiftool -AllDates+=5:00 -datetime+=5:00 "-timeZoneOffset=+2" -TimeZoneCity#=18 "-FileCreateDate<DateTimeOriginal" "-FileModifyDate<DateTimeOriginal" -overwrite_original .

resulting in:

File Modification Date/Time     : 2022:07:13 09:57:12+02:00
File Access Date/Time           : 2022:07:13 09:57:12+02:00
File Creation Date/Time         : 2022:07:13 09:57:12+02:00
:
:
Date/Time Original              : 2022:07:13 14:57:12
Offset Time                     : -03:00
Offset Time Original            : -03:00
Offset Time Digitized           : -03:00
:
:
Time Zone                       : -03:00
Time Zone City                  : Cairo
Daylight Savings                : Off
:
:
Time Stamp                      : 2022:07:13 09:57:12.23
:
:
Create Date                     : 2022:07:13 14:57:12.23-03:00
Date/Time Original              : 2022:07:13 14:57:12.23-03:00
Modify Date                     : 2022:07:13 14:57:12.23-03:00

Please help me to change all the fields.
Any help appreciated, Hans

StarGeek

Change which ones?  The command you used looks correct overall, but I don't know which tags you want to change.  Also, use the command in FAQ #3 so we can see duplicate tags and the groups they belong to.
* 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).

Neal Krawetz

Hi Hans Kraus,

I think you might be confusing the purpose of some of these metadata fields.

File Modification Date/Time     : 2022:07:13 09:57:16+02:00
File Access Date/Time           : 2022:07:14 15:35:25+02:00
File Creation Date/Time         : 2022:07:13 09:57:12+02:00


These three "File" fields are describing the file on your local computer. This is not metadata stored inside the file; this is metadata about the file. (Ignore it.)

The rest are reporting metadata found inside the file. The EXIF metadata says "Offset Time: -03:00", so it's -03:00.  I think the "Time Zone" and "Time Zone City" come from the MakerNotes metadata.

(Also, while Sao Paulo Brazil is in -03:00, Cairo Egypt is in +02:00.)

Hans Kraus

Change what? Simply all the fields I reported. As far as I can remember there is an exiftool command to change all the metadata about the file too.
City: I tried to chane it from Sao Paulo to Paris with daylight savings activated. Therefore I want to set the daylight savings flag too. Afterwards it should report Paris instead of Cairo.

Regards, Hans

StarGeek

Change it to what?  What are the values you are expecting?  From what I can see, the DateTimeOriginal was shifted +5 hours, which seemed to be what you wanted.

The TimeZoneOffset offset was set to +2, but that is a non-standard tag and unlikely to be used by any program. What you want to set are the OffsetTime* tags.  That can be done with
exiftool -OffsetTime*=+02:00 /path/to/files/

To change TimeZoneCity to Paris, just set it equal to Paris. Don't try to deal with the raw numbers. And for the DaylightSavings tag, the same, just set it to On
exiftool -TimeZoneCity=Paris -DaylightSavings=On /path/to/files/

One thing to take note of is that Canon TimeZone tag is supposed to be set to Standard time for location where the image was taken, regardless of whether it was Daylight Saving or not.  The DaylightSavings tag is what tells the Canon camera if the time needs to be adjusted. The only thing that will read these tags is a Canon camera anyway.

You can use this command to just list the time related tags in a file.  It is important to make sure that you see duplicate tags and the groups they belong to
exiftool -time:all -G -a -s File.jpg
* 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).

Hans Kraus

Thanks for the answers. I now tried:

exiftool -AllDates+=5:00 -datetime+=5:00 "-timeZoneOffset=+2" -OffsetTime*=+02:00 -DaylightSavings=On -TimeZoneCity=Paris -timezone+=5:00 -timestamp+=5:00 "-FileCreateDate<DateTimeOriginal" "-FileModifyDate<DateTimeOriginal" -progress -overwrite_original .

which gave the warnings:
Quote
Warning: Shift value for Ricoh:TimeZone is not a number
Warning: Shift value for XMP-apple-fi:TimeStamp is not a number
and afterwards:

exiftool "-FileCreateDate<DateTimeOriginal" "-FileModifyDate<DateTimeOriginal" -progress -overwrite_original .

whitch did most of the changes I want. Two wrong entries remain (see also the warnings above):

Time Zone                       : -03:00
Time Stamp                      : 2022:07:13 09:57:12.23

These entries should be:

Time Zone                       : +02:00
Time Stamp                      : 2022:07:13 14:57:12.23

The files/exif entried to be modified are from a Canon EOS R5.

Regards, Hans

StarGeek

Timezone cannot be shifted.  Set it directly the same as the Offset tags.

TimeStamp may not be writable or shiftable.  It depends upon group.  Again, use the command in FAQ #3 so the actual tag names and groups are listed.

Once you figure out the group it belongs to, check the listings for Canon tags on the Tag names page. They can be found under Canon, CanonCustom, CanonVRD, and CanonRaw on that page.
* 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).

Hans Kraus

Hi,
the output of

exiftool -a -G1 -s .

is (only the TimeStamp line listed):

[Track4]        TimeStamp                       : 2022:07:13 09:57:12.23

The output of

exiftool -time:all -G -a -s .

is:

[MakerNotes]    TimeStamp                       : 2022:07:13 09:57:12.23

I don't find that entry on all of the Canon tags on the Tag names page.
I tried to change the MakerNotes with:

exiftool.exe -makernotes:timestamp+=5:00 -overwrite_original .

but got the result:

    1 directories scanned
    0 image files updated
    1 image files unchanged

I'd either like to change it or - second best - delete it.
Regards, Hans

StarGeek

What kind of file is it?  The presence of a Track entry indicates a video file.  Either way, this sounds like the tag is not editable.
* 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).

Phil Harvey

The ability for ExifTool to write maker notes in video files is sort of patchy.  Working on this has been on the to-do list for quite a while, but there isn't much demand for this sort of thing so it has been low on the list.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Hans Kraus

The file is a Canon Raw Image CR3 file from the EOS R5.
Link to one of the pics: https://www.jottacloud.com/s/116ca6bd9b68423427c9b6cb405dfa5a25a
Thanks, Hans

Phil Harvey

Ah, OK.  This is actually even more difficult to implement since the TimeStamp in CR3 files is written in the timed metadata of the video stream.  I would have realized this if I read your post carefully since it is in Track 4.  (The CR3 file format is based on the MP4 video file format.)

Implementing the ability to write timed metadata in video files probably won't happen. :(

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Hans Kraus

Thanks a lot for your help and especially Phil Harvey for exiftool.
A small problem remains:

Time Zone                       : -03:00

I tried:

exiftool -timezone=2 -progress -overwrite_original .
exiftool -TimeZone=2 -progress -overwrite_original .
exiftool -TimeZone=+2 -progress -overwrite_original .
exiftool "-Time Zone=2" -progress -overwrite_original .
exiftool "-Time Zone+=2" -progress -overwrite_original .

But nothing changed it. That was reported too by exiftool (Nothing changed in ./_DSR9861.CR2).
Kind regards, Hans

Hans Kraus

Hi, thanks to all who have helped. The following command changed the time zone from Sao Paulo -> Paris (+5h including daylight saving in Paris):

exiftool -AllDates+=5:00 -datetime+=5:00 "-timeZoneOffset=+2" -OffsetTime*=+02:00 -DaylightSavings=On -makernotes:timezone+=300 -TimeZoneCity=Paris -progress -overwrite_original .

And the following from Sao Paulo -> Caracas (-1h):

exiftool -AllDates-=1:00 -datetime-=1:00 "-timeZoneOffset=-4" -OffsetTime*=-04:00 -DaylightSavings=Off -makernotes:timezone+=-60 -TimeZoneCity=Caracas -progress -overwrite_original .

Regards, Hans