TIMEZONE SHIFT / CHANGE

Started by jeffayn, November 08, 2019, 08:49:17 AM

Previous topic - Next topic

jeffayn

First of all.. I love exiftool, it give me alot of metadata i need to understand my files.. however, lately i come across a bigger issue when I am dealing with google photos.. as they take timezone into consideration as well... that create a ruckus for me...  >:(

after some searching I got this

exiftool -xmp:dateTimeOriginal="2005:10:23 20:06:34.33-05:00" a.jpg

this line will actually let me to get the date taken and time zone taken care.. however.. I got more than 2000 photos I need to take care off...
Any one can show me the script that I can use to use the existing Date Taken but instead of GMT+0800 become GMT+0100 in batch process...

Thank you so much....

I am sorry as I cant do simple HTML.. so please forgive my nobbishness...

Phil Harvey

Hi Jeff,

Maybe you want something like this:

exiftool "-xmp:datetimeoriginal<${exif:datetimeoriginal}+01:00" -globaltimeshift -7 -r DIR

This will write XMP:DateTimeOriginal with a time zone of "+01:00" based on the value of EXIF:DateTimeOriginal minus 7 hours (which should be correct if the camera time zone was +08:00).

- 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 ($).

jeffayn

#2
I just try ... the google photo still recognized it as GMT+0800.... so what mistake I might have done ?

I did some fooling around... I notice that for this Nikon D60 model... this script

exiftool -xmp:dateTimeOriginal="2005:10:23 20:06:34.33-05:00" a.jpg

only works after I remove all data .. or else it wont work , it just stuck at GMT+0800


StarGeek

It is possible to commit no mistakes and still have the wrong results.

Last time I tried to figure out what Google Photos did time zone wise, I was on a fast train to madness.  I tried using VPNs to upload from different places around the world and would get results that made no sense.  I would be randomly be Pacific time zone or Eastern time zone.

I just now tried again with a test file filled with a lot of time data and this time it picked the EXIF:DateTimeOriginal, which was normal, but had a time zone of GMT+00:00.  Which is yet another completely different result than my previous tests.

I'll do some quick testing to see what I can come up with, but keep in mind that it may not be possible.  Additionally, your results may also differ if google thinks you live in a different country than the US, as I remember trying to help someone who was based in Europe on a different Google issue and Google served up completely different results for them compared to what I received.
* 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).

jeffayn

I remove the metadata 1 by 1.. the culprit is MakersNote..

so any chance I can do this without removing it ?... or just tweak the makernote meta ?

StarGeek

I spent a few minutes doing some testing and everything I uploaded displayed a time zone of GMT+00:00.  Which was completely different from all previous results I had done.  But I finally realized that unlike my previous tests a few years back, my test image now had GPS coordinates, in this case near Abidjan, Côte d'Ivoire.  And that time zone is GMT+00:00.

So the first takeaway from this is that if you have correct GPS coordinates, Google Photos will determine the time zone from that.  This is info that I'm happy to have come across.

I'm going to remove the GPS data from the file and do some more testing without it.

One other thing to watch for, some times Google Photos takes a few minutes to properly update the metadata it displays.  There have been a few cases in the past were it would take 5-10 minutes to get the actual results on the web 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).

StarGeek

Quote from: jeffayn on November 08, 2019, 10:36:38 AM
I remove the metadata 1 by 1.. the culprit is MakersNote..

so any chance I can do this without removing it ?... or just tweak the makernote meta ?

Interesting.  Can you list the output of this command:
exiftool -Makernotes:time:all -g1 -a -s FILE.JPG

Maybe that will give a clue as to what Google Photos is reading.  I'm actually a bit surprised that it's reading the MakerNotes.  That's going to add a whole other dimension to my testing.
* 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).

StarGeek

Ok, now Google is surprising the heck out of me.  After I (thought) I removed the GPS data with exiftool -gps*=, Google Photos started showing a time zone of +06:00 for all the photos I uploaded.  Then I noticed that it was showing a GPS position in the middle of the ocean off the Kirov Islands, Russia.  I finally figured out that it was reading LocationCreatedGPSLatitude and LocationCreatedGPSLongitude.  This is the first time I've seen anything (other than maybe Lightroom/Photoshop) read the IPTC Extension schema tags.

It looks like Google has really upped their game in reading metadata.
* 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).

StarGeek

#8
I still have to check the XMP GPS tags and MakerNotes tags, but the following tags will override any other time zone, including XMP tags which can include a time zone.

EXIF:GPSLatitude + EXIF:GPSLongitude
XMP:LocationCreatedGPSLatitude + XMP:LocationCreatedGPSLongitude
XMP:LocationShownGPSLatitude + XMP:LocationShownGPSLongitude
EXIF:OffsetTimeOriginal
EXIF:OffsetTimeDigitized
EXIF:OffsetTime


So if you don't have GPS coordinates set, the easiest way to set a time zone would be to set EXIF:OffsetTimeOriginal.

Edit 1: I copied the Nikon MakerNotes from one of my Nikon D5100 pictures with Timezone set to +00:00 and then -11:00, in both cases Google Photos ignored the timezone in the MakerNotes.  I then copied the MakerNotes from the D60 sample in Phil's metadata repository.  No timezone was read from the file.

Edit 2: Google Photos doesn't read the XMP GPS tags.  There has been a change in what tags is uses to determine the date/time of the image, adding XMP-tiff:DateTime to the list.  And previously, it would read the GPS:GPSDateStamp and GPS:GPSTimeStamp but treat them as local time rather than UTC time.  Now it will adjust it by the timezone. 

If none of the above tags are set, the time zone assumed by Google Photos may be set to the time zone of the computer uploading.  I'm not sure, as in the past I sometimes got varied results, either east or west coast USA.

My limited testing of MakerNotes did not produce any time zone or time stamp changes.  YMMV
* 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).

jeffayn

I am sorry, I hope i am as savvy as you wish me to be.. but I am just blank as a newborn baby for thing like this.... hahaa..

however, i tried few other metadata remove to see how Phil script work...and I am 100% sure for my case that it is the Makernotes that is causing the trouble...

If you may can you elaborate more on how I should write the script using your
EXIF:OffsetTimeOriginal
approach.. i need an exact script example to play around.. because as you know i am total idiot come to scripting..

StarGeek

You would just set it to the time zone desired.  For example
exiftool -EXIF:OffsetTimeOriginal=+01:00 <FileOrDir>

Replacing <FileOrDir> with the files and/or directories you want to process.

Might I ask what country you are uploading from?  As I mentioned, in one case where I was trying to help someone in another country with Google Photos, they had completely different results than what I was seeing.

Also, what is the output from this command on one of the files you're uploading.  You can drag/copy in the command line and then paste it here.
exiftool -Makernotes:time:all -g1 -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).

jeffayn

I am from Malaysia.. so my default GMT should be +0800 ... but if I am travelling.. the GMT jump all over because of different devices I am using... Phone, Camera, GoPro etc... it is a nuisance.. even an hour difference in GMT it make my photo so disorganized...

Thanks your Exiftool and you guys help... I am now slight more in control... hahaha...

for example the stubborn photo i try to mod is this i just use plain exif
ExifTool Version Number         : 11.68
File Name                       : 20131004 032853 DSC_4888.jpg
Directory                       : C:/Users/JnOffice/Downloads/00 EXIF TOOL GUI/exiftool-11.68
File Size                       : 4.4 MB
File Modification Date/Time     : 2013:10:04 03:28:53+08:00
File Access Date/Time           : 2013:10:04 03:28:53+08:00
File Creation Date/Time         : 2013:10:04 03:28:53+08:00
File Permissions                : rw-rw-rw-
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Big-endian (Motorola, MM)
Make                            : NIKON CORPORATION
Camera Model Name               : NIKON D60
Orientation                     : Horizontal (normal)
X Resolution                    : 300
Y Resolution                    : 300
Resolution Unit                 : inches
Software                        : Ver.1.01
Modify Date                     : 2013:10:04 03:28:53
Y Cb Cr Positioning             : Co-sited
Exposure Time                   : 1/80
F Number                        : 4.8
Exposure Program                : Aperture-priority AE
ISO                             : 1600
Exif Version                    : 0221
Date/Time Original              : 2013:10:04 03:28:53
Create Date                     : 2013:10:04 03:28:53
Components Configuration        : Y, Cb, Cr, -
Compressed Bits Per Pixel       : 4
Exposure Compensation           : -2/3
Max Aperture Value              : 4.6
Metering Mode                   : Multi-segment
Flash                           : No Flash
Focal Length                    : 29.0 mm
Maker Note Version              : 2.10
Color Mode                      : Color
Quality                         : Fine
White Balance                   : Auto
Focus Mode                      : AF-A
Flash Setting                   : Normal
Flash Type                      :
White Balance Fine Tune         : 0 0
WB RB Levels                    : 1.48046875 2.11328125 1 1
Program Shift                   : 0
Exposure Difference             : 0
Compression                     : JPEG (old-style)
Preview Image Start             : 3988
Preview Image Length            : 25430
Flash Exposure Compensation     : 0
ISO Setting                     : 1600
Image Boundary                  : 0 0 3872 2592
External Flash Exposure Comp    : 0
Crop Hi Speed                   : Off (3904x2616 cropped to 3904x2616 at pixel 0,0)
Serial Number                   : 8118025
VR Info Version                 : 0100
Vibration Reduction             : Off
VR Mode                         : Normal
Active D-Lighting               : Off
Time Zone                       : +09:00
Daylight Savings                : No
Date Display Format             : Y/M/D
ISO Expansion                   : Off
ISO2                            : 1600
ISO Expansion 2                 : Off
Tone Comp                       : Auto
Lens Type                       : G VR
Lens                            : 18-55mm f/3.5-5.6
Flash Mode                      : Did Not Fire
AF Area Mode                    : Dynamic Area
AF Point                        : Center
AF Points In Focus              : Center
Shooting Mode                   : Single-Frame
Color Hue                       : Mode3a
Light Source                    : Natural
Shot Info Version               : 0211
Hue Adjustment                  : 0
Noise Reduction                 : Off
WB RGGB Levels                  : 379 256 256 541
Lens Data Version               : 0202
Exit Pupil Position             : 93.1 mm
AF Aperture                     : 4.5
Focus Position                  : 0x22
Focus Distance                  : 0.94 m
Lens ID Number                  : 154
Lens F Stops                    : 5.33
Min Focal Length                : 18.3 mm
Max Focal Length                : 55.0 mm
Max Aperture At Min Focal       : 3.6
Max Aperture At Max Focal       : 5.7
MCU Version                     : 156
Effective Max Aperture          : 4.6
Sensor Pixel Size               : 6.05 x 6.05 um
Date Stamp Mode                 : Off
Retouch History                 : None
Image Data Size                 : 4584461
Shutter Count                   : 27859
Flash Info Version              : 0102
Flash Source                    : None
External Flash Firmware         : n/a
External Flash Flags            : (none)
Flash Commander Mode            : Off
Flash Control Mode              : Off
Flash Compensation              : 0
Flash GN Distance               : 0
Flash Group A Control Mode      : Off
Flash Group B Control Mode      : Off
Flash Group C Control Mode      : Off
Flash Group A Compensation      : 0
Flash Group B Compensation      : 0
Flash Group C Compensation      : 0
Image Optimization              : Normal
Vari Program                    :
Multi Exposure Version          : 0100
Multi Exposure Mode             : Off
Multi Exposure Shots            : 0
Multi Exposure Auto Gain        : Off
High ISO Noise Reduction        : Normal
Power Up Time                   : 2013:10:04 04:13:35
File Info Version               : 0100
Memory Card Number              : 0
Directory Number                : 100
File Number                     : 4888
Retouch Info Version            : 0100
User Comment                    :
Sub Sec Time                    : 50
Sub Sec Time Original           : 50
Sub Sec Time Digitized          : 50
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 3872
Exif Image Height               : 2592
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
Sensing Method                  : One-chip color area
File Source                     : Digital Camera
Scene Type                      : Directly photographed
CFA Pattern                     : [Green,Blue][Red,Green]
Custom Rendered                 : Normal
Exposure Mode                   : Auto
Digital Zoom Ratio              : 1
Focal Length In 35mm Format     : 43 mm
Scene Capture Type              : Standard
Gain Control                    : High gain up
Contrast                        : High
Saturation                      : Normal
Sharpness                       : Normal
Subject Distance Range          : Unknown
Thumbnail Offset                : 29556
Thumbnail Length                : 8497
Image Width                     : 3872
Image Height                    : 2592
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:2 (2 1)
Aperture                        : 4.8
Blue Balance                    : 2.113281
Image Size                      : 3872x2592
Megapixels                      : 10.0
Preview Image                   : (Binary data 25430 bytes, use -b option to extract)
Red Balance                     : 1.480469
Scale Factor To 35 mm Equivalent: 1.5
Shutter Speed                   : 1/80
Create Date                     : 2013:10:04 03:28:53.50
Date/Time Original              : 2013:10:04 03:28:53.50
Modify Date                     : 2013:10:04 03:28:53.50
Thumbnail Image                 : (Binary data 8497 bytes, use -b option to extract)
Lens ID                         : AF-S DX VR Zoom-Nikkor 18-55mm f/3.5-5.6G
Lens Spec                       : 18-55mm f/3.5-5.6 G VR
Circle Of Confusion             : 0.020 mm
Depth Of Field                  : 0.20 m (0.85 - 1.06 m)
Field Of View                   : 44.2 deg (0.77 m)
Focal Length                    : 29.0 mm (35 mm equivalent: 43.0 mm)
Hyperfocal Distance             : 8.65 m
Light Value                     : 6.8

as you can see, nothing indicate is a GMT+0900 but when I use your code this pop up

---- Nikon ----
TimeZone                        : +09:00
DaylightSavings                 : No
DateDisplayFormat               : Y/M/D
PowerUpTime                     : 2013:10:04 04:13:35

thanks to you I can now check all my file without dumping it one by one to google photo !

Just a question, how do I do your script to check all photo in a folder <DIR>?

StarGeek

Just give exiftool a directory instead of a file to have it process a whole directory.
* 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).

jeffayn

i tried your method and phil as well...

Both work.. and google photo successfully show the intended GMT but only by either
removal of Makernotes & GPS


StarGeek

Try just removing the GPS coordinates but keep the makernotes
exiftool -gps*= File.jpg

My testing earlier today showed that if the GPS coordinates were in the file, the timezone at that location would override anything else.
* 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).