Apple Event: May 7th at 7 am PT

Movie dates and Photos.app

Last modified: Apr 6, 2024 11:41 AM
22 13117 Last modified Apr 6, 2024 11:41 AM

This page explains how to fix incorrect sorting of movies and images and also some related details. The page initially described the messy and sadly still not yet standardized movie metadata. The page has been updated so it covers more than the headline indicates.


Summary:


When Photos.app imports images and movies:


1. Movie's or image's metadata sets the date and time, and computer's location sets the time zone.


The following internal metadata tags might affect sorting up to ±12 hours if they happen to be present in some movie or image:


2. 'GPS' location sets the time zone.


3. If 'Keys:CreationDate' in a movie or 'ExifIFD:OffsetTimeOriginal' metadata in an image exists, it overrides all other time zones.


4. Photos.app time zone display must be manually enabled.


Usually it is easiest to fix sorting inside Photos.app or before importing with a 3rd party tool like GraphicConverter 12. Command line app exiftool has numerous other options and its basic commands are also briefly explained (use v12.76 or later).


------------------------------------------------------------------------


Details:


If movies and images sort incorrectly in macOS 13-14 Ventura-Sonoma Photos.app, it is possible to either a) correct the dates, time zones and GPS in Photos library (the edits then go to Photos library database, not to the originals). Or b) losslessly edit dates, time zones and GPS in the originals with tools like GraphicConverter or exiftool before importing them to Photos.


a) Correct the dates, time zones and GPS in Photos library (the edits then go to Photos library database, not to the originals):


Fix incorrect sorting by shifting dates and time zones: Photos.app > [select images and movies] > Image > Adjust Date and Time... > Adjusted [set desired date and time], Closest City [type and select a city from the list]. Notice that all dates are shifted by that amount, and time zone (New York, Berlin etc), and DST adjustment (EST/EDT, GMT+1/GMT+2 etc) is automatically set for that date and location.


Set location: Photos.app > [select images and movies] > Window > Info [Command-I] > Assing a Location [type and select a city from the list or paste GPS formatted as 40.74842, -73.98561 or 40.74842 -73.98561]. If there is already a location, first hide it via Image > Location > Hide Location. Or copy & paste Photos location via Image > Location > Copy Location & Image > Location > Assign Location. Changing location inside Photos library does not affect time zone.


Edit Title, Author, Rating, Keywords, and Description: Photos.app > [select images and movies] > Window > Info [Command-I] > Add a Title, Caption, Keyword [write Title, Caption, Keywords (optionally confirm a Keyword with Return)].


Images and movies exported from Photos should have the correct internal metadata dates but might have current file system creation and modification dates which is only a cosmetic issue but this is a source of much confusion. To copy movie and image internal metadata dates to file system creation and modification dates choose GraphicConverter 12 > File > Browse... > [select folder] > [select files] > Calendar menu > Date > Set File Creation and Modification Date with Exif Date. Also 3rd party tools like A Better Finder Rename, exiftool etc can do this.


The common internal movie metadata date 'QuickTime:CreateDate' is not readily displayed outside Photos.app but 'Keys:CreationDate' as well as GPS, Title, (or Headline), Author, Keywords, and Description are displayed in QuickTime Player.app > Window > Show Movie Inspector [Command-I]. Author, Keywords, and Description are displayed in Finder > View > Show Preview > Show More. GPS, Author, Keywords, and Description are displayed in Finder > Get Info for .mp4 and .mov (not for .m4v).


Internal image metadata date 'ExifIFD:DateTimeOriginal' as well as GPS can be checked outside Photos.app in Finder > View > Show Preview > Show More > 'Content Created' date in the right side panel. Or in Preview.app > Tools > Show Inspector > i > Exif > 'Date Time Original' field which shows also the possible Time Zone info -- GPS info is also in that dialog. GPS, Title, Headline, Keywords, and Description are displayed in Finder > Get Info.


Photos can export original pixel data with updated metadata in .xmp sidecar files via Photos.app > [select images and movies] > File > Export > Export Unmodified Originals > Export IPTC as XMP. You can join the updated metadata in the .xmp to the original images and movies with GraphicConverter 12 (or exiftool): GraphicConverter > File > Browse... > [select folder] > [select files] > IPTC/XMP menu > XMP Sidecar File... > Copy into JPEGs, TIFFs, PNGs, webp, HEICs, MOVs, MP4s, M4Vs. Notice that GraphicConverter deletes movie .xmp files so you might want to make a backup before that command.


Notice that macOS 10.15-14 Catalina - Sonoma Photos.app exports non-standard .xmp GPS but GraphicConverter 12 and exiftool have a workaround for that (otherwise western and southern locations are put to the other side of the globe!). Photos.app can also not properly import .xmp sidecars: it ignores date and GPS in images and silently fails to import movies with sidecar .xmp files! So it is best to use those 3rd party tools to join .xmp to the originals and then delete .xmp files before importing to Photos.


That flawed Photos .xmp can be fixed with exiftool:


exiftool -P -overwrite_original -ext xmp -XMP-exif:All= -tagsFromFile @ -XMP-exif:All '-XMP-exif:GPSLongitude<${XMP-exif:GPSLongitude#}${XMP-exif:GPSLongitudeRef#}' '-XMP-exif:GPSLatitude<${XMP-exif:GPSLatitude#}${XMP-exif:GPSLatitudeRef#}' .


Then the following command can be used to copy .xmp to .jpg and .heic images (here to both XMP and IPTC, File dates use XMP-photoshop offset so they might be off):


exiftool -m -overwrite_original -ext jpg -ext heic '-IPTC:CodedCharacterSet=UTF8' -tagsFromFile %d%f.xmp '-AllDates<XMP-photoshop:DateCreated' '-ExifIFD:OffsetTime*<XMP-photoshop:DateCreated' '-XMP-photoshop:DateCreated<XMP-photoshop:DateCreated' '-EXIF:All<XMP-exif:All' '-GPS:GPSLatitudeRef<Composite:GPSLatitudeRef' '-GPS:GPSLongitudeRef<Composite:GPSLongitudeRef' '-XMP:All<XMP:All' --XMP-exif:GPSDateTime '-IPTC:ObjectName<XMP-dc:Title' '-IPTC:Caption-Abstract<XMP-dc:Description' '-EXIF:ImageDescription<XMP-dc:Description' '-IPTC:Keywords<XMP-dc:Subject' '-FileCreateDate<XMP-photoshop:DateCreated' '-FileModifyDate<XMP-photoshop:DateCreated' .


...and to .mp4, .m4v and .mov movies:


exiftool -m -overwrite_original -api QuickTimeUTC=1 -ext mp4 -ext m4v -ext mov -tagsFromFile %d%f.xmp '-QuickTime:CreateDate<XMP-photoshop:DateCreated' '-QuickTime:ModifyDate<XMP-photoshop:DateCreated' '-Track*Date<XMP-photoshop:DateCreated' '-Media*Date<XMP-photoshop:DateCreated' '-Keys:CreationDate<XMP-photoshop:DateCreated' '-Keys:GPSCoordinates<$XMP:GPSLatitude#, $XMP:GPSLongitude#' '-Keys:Title<XMP-dc:Title' '-Keys:Description<XMP-dc:Description' '-Keys:Keywords<XMP-dc:Subject' '-FileCreateDate<XMP-photoshop:DateCreated' '-FileModifyDate<XMP-photoshop:DateCreated' .


So GraphicConverter 12 and exiftool can workaround the flawed .xmp that Photos.app exports essentially the same. Minor differences in those apps are that GraphicConverter does not write OffsetTime*, file dates and Keys:CreationDate (those tags might then need another GraphicConverter command). GraphicConverter copies the nonstandard XMP-exif:GPS*Ref tags to images but nevertheless correctly writes references to XMP-exif:GPSLatitude and GPSLongitude so all apps read that OK (GPS:GPS* tags are OK). On the other hand, GraphicConverter copies those nonstandard .xmp locations incorrectly to movies, so XMP in movies should be disabled in GraphicConverter > Settings... > Browser > Edit Metadata 1 > Movie (MOV, MP4, M4V and MTS) editing: XMP data: Do nothing. None of Apple's apps read XMP in movies anyway but Adobe apps might do so.


https://exiftool.org/forum/index.php?topic=12634.msg68327#msg68327

https://exiftool.org/forum/index.php?topic=14943.msg80546#msg80546


Sorting options for the various views in a Photos library:


Photos sorting - Apple Community


Thematic Index to Photos for Mac related User Tips:


Thematic Index to Photos for Mac related … - Apple Community


Older macOS like 10.15 Catalina Photos.app could display the time zone in its Window > Info when it was added as a custom preference to macOS Language & Region > Advanced... > Times > drag the Time Zone to the Medium length format and set its format as desired (+02:00, for example). However, this GUI option is not present in macOS 13 Ventura or later. Time zone display can be enabled in macOS 13-14 Ventura-Sonoma Photos.app via the Terminal with (re-launch Photos so it takes effect):


defaults write NSGlobalDomain AppleICUTimeFormatStrings -dict-add "2" "HH:mm:ss z"


...and reverted to the default time zone-less display with:


defaults delete NSGlobalDomain AppleICUTimeFormatStrings

------------------------------------------------------------------------


Movies:


b) Edit the originals so they import correctly to Photos library:


macOS 13-14 Ventura-Sonoma Photos.app prioritizes sorting imported .mp4, .m4v and .mov movies in the following order. Sorting images is explained later in this page.


1. Usually movie's internal metadata 'QuickTime:CreateDate' sets the date and time. If it or any other internal metadata date is not present, then as a last resort Photos grabs the date from macOS file system 'MacOS:FileCreateDate' (social media sites like Facebook, WhatsApp etc strip internal metadata from images and movies). Modifying a movie usually changes macOS file system 'System:FileModifyDate' but Photos ignores that date when importing anyway.


In both cases movie's time zone is set using the computer's time zone location (standard time New York EST -05:00, Berlin +01:00, for example) when the movie is imported to Photos library. DST for that date is also automatically set (daylight saving time New York EDT -04:00, Berlin +02:00, for example).


Movies should use UTC time in the 'QuickTime:CreateDate' tag. Photos.app converts it to computer's local time when importing. So a computer in New York converts 12:00 UTC to 07:00:00-05:00, and in Berlin to 13:00:00+01:00, for example.


Also macOS file system 'MacOS:FileCreateDate' time changes depending on the computer's time zone location in a similar manner. File system time stamps are similar to the QuickTime time stamps: they are basically UTC, but the computer automatically shows the time adjusted to the computer's local time zone. It is best to set the date to the internal metadata dates because file dates are fragile.


Changing the computer to another time zone preserves the time and time zone in the previously imported images.


If present, the following internal metadata tags override previously mentioned time or time zone, and the time zone might affect sorting up to ±12 hours if it happens to be present in some movie:


2. GPS location in 'Keys:GPSCoordinates' or 'UserData:GPSCoordinates' sets the time zone. Keys overrides UserData if both exist (Photos ignores this UserData tag in .mp4 and .m4v). Notice that the time zone might be different in the same longitude depending on the latitude. For example, Dhaka in Bangladesh is +06:00 while the same longitude in China is +08:00.


3. Date in 'Keys:CreationDate' or 'UserData:DateTimeOriginal' sets the time and time zone, and it overrides all other time and time zone tags above. Keys overrides UserData if both exist (Photos ignores this UserData tag in .mov). iOS (8.4)-9 and newer inserts 'Keys:CreationDate' to its movies.


If those #3 tags erroneously happen to be written without time zone, then Photos converts the time in imported movie to 'UTC ± computer's time zone' and displays computer time zone. In another words, it converts UTC to computer's local time. So a computer in New York displays 12:00 UTC as (12:00-05:00) 07:00 EST, and in Berlin as (12:00+01:00) 13:00 GMT+1, for example. BTW macOS 10.15-12 Catalina-Monterey Photos scrambled the year to something like '5828963' if there was no time zone in those tags but this was fixed in macOS 13 Ventura and later (exiftool -ver 12.13 and later automatically adds time zone unless its -n option is used).


Those relevant movie date tags can be checked in more detail with GraphicConverter > File > Browse... > [select folder] > [select file] > i [at lower right] > ExifTool tab.


Or with an exiftool command below (use a period '.' instead filename to check all files in that folder):


exiftool -a -G1 -s -n -fileOrder5 FileName -api QuickTimeUTC=1 -FileCreateDate -FileModifyDate -CreateDate -GPSCoordinates -DateTimeOriginal -CreationDate movie.mp4

[MacOS]         FileCreateDate                  : 2001:01:01 12:00:00-05:00
[System]        FileModifyDate                  : 2001:01:01 12:00:00-05:00
[QuickTime]     CreateDate                      : 2001:01:01 12:00:00-05:00
[UserData]      DateTimeOriginal                : 2001:01:01 12:00:00-05:00
[Keys]          CreationDate                    : 2001:01:01 12:00:00-05:00
[UserData]      GPSCoordinates                  : 40.74842 -73.98561 443.2
[Keys]          GPSCoordinates                  : 40.74842 -73.98561 443.2

Or with more detail:

exiftool -a -G1 -s -n -fileOrder5 FileName -api QuickTimeUTC=1 -FileCreateDate -Time:All -Location:All movie.mp4

exiftool -a -G1 -s -api QuickTimeUTC=1 -api RequestAll=2 movie.mp4


https://www.lemkesoft.de/en/products/graphicconverter/


https://exiftool.org/


There is a short exiftool manual at the end of this page.


If needed, write internal metadata date and time to a movie or image with GraphicConverter > File > Browse... > [select folder] > [select files] > Camera menu > Set Exif Date to > User Defined Date... > [set date and time] Additional options > Set the file creation/modification date, (optional: Set Exif date/time modified, Set Exif date/time digitized etc), Set movie tags (MOV, MP4, M4V and MTS only), Use UTC.


'QuickTime:CreateDate' tag is always present in movies (although sometimes encoded without any value as 0000:00:00 -- that might be displayed also as 1903:12:31 or 1904:01:01). That UTC-based tag does not include a time zone because the time zone is computed on the fly based upon the computer's local time zone.


On the other hand, 'Keys:CreationDate' does usually have a time zone, but that Keys tag might not always be present in a movie. So, if you want to modify 'Keys:CreationDate' time zone, you might first have to create that tag with GraphicConverter 12 > File > Browse... > [select folder] > [select files] > Metadata menu > Metadata Specifics > Copy Date to Keys:CreationDate (Only movies). After that the 'Set Exif Date Time Zone...' can take effect for that movie.


In .mp4 and .mov 'Keys:CreationDate' time zone can be edited with GraphicConverter 12 > File > Browse... > [select folder] > [select files] > Camera menu > Modify Exif Date > Set Exif Date Time Zone... > Set Time Zone (in .m4v currently possible only via Set Exif Date to... > User Defined Date... > Time Zone).


Movie time and time zone Keys tags can be added and edited in exiftool with a command like (the FileCreateDate part of the command asks for "setfile" Xcode Command Line Tools install. It can be ignored and the only drawback is usually not being able to set future FileCreateDate dates because with this kind of command FileCreateDate usually follows FileModifyDate anyway. The install is quite small ~2 GB and fast, not the larger Xcode install, so you might install it to get rid of that nag):


exiftool -m -overwrite_original -api LargeFileSupport=1 -api QuickTimeUTC=1 '-QuickTime:CreateDate=2001:01:01 12:00:00' '-Keys:CreationDate=2001:01:01 12:00:00-05:00' '-FileCreateDate=2001:01:01 12:00:00' '-FileModifyDate=2001:01:01 12:00:00' movie.mp4


The earliest date 'QuickTime:CreateDate' supports is 1904:01:01 00:00:00 UTC. On the other hand, 'Keys:CreationDate' supports dates as early as 0001:01:01 00:00:00. Photos.app can read that year 0001 but usually it is best to also use 'Keys:CreationDate' for dates before 1970 because apps like Google Photos need it for earlier movie dates.


When fixing incorrect sorting it is often easiest to edit 'Keys:CreationDate' time and time zone in selected movies because it overrides other time tags. Changing the computer's time zone is best be avoided because it gets messy.


That said, it is possible to set a different time zone without touching the computers's clock (but notice that Photos.app is still in the computer's time zone when it imports the movies). That can be simulated with exiftool option and a TZ identifier like '-api TimeZone=America/New_York' -- it automatically looks if DST is used in that location on that date (Asia/Tokyo did not have DST in 2001, for example):


exiftool -m -wm w -overwrite_original -api LargeFileSupport=1 -api QuickTimeUTC=1 -api TimeZone=America/New_York '-QuickTime:Time:All=2001:07:01 12:00:00' 2001-0701-1200-00.mp4

exiftool -a -G1 -s -api QuickTimeUTC=1 -api TimeZone=America/New_York -CreateDate -CreationDate 2001-0701-1200-00.mp4 
[QuickTime]     CreateDate                      : 2001:07:01 12:00:00-04:00
[Keys]          CreationDate                    : 2001:07:01 12:00:00-04:00


https://en.wikipedia.org/wiki/Time_zone

https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

https://www.youtube.com/watch?v=-5wpm-gesOY


I recommend inserting the date to the filename in images and movies. 3rd party apps like GraphicConverter, A Better Finder Rename, exiftool etc can do this automatically by copying the internal metadata date to the filename (and optionally also to the file creation & modification dates) as something like 2001-0101-1200-00.mp4.


To copy movie and image metadata dates to filenames, choose GraphicConverter > File > Browse... > [select folder] > [select files] > File > Rename... [Command-E] > Name tab: Change filename: [blank] > Date tab: Add date to filename: Exif date, GC Date format default: YYYY-MM-DD hh.mm.ss (or almost anything you prefer -- I dislike spaces in these filenames so I use YYYY-MMDD-hhmm-ss).


To copy movie metadata dates to filenames can be done in exiftool with the following command (filename looks like 2001-0101-1200-00.mp4 and will append _NUM if CreateDate is the same for multiple files):


exiftool -m -P -fileOrder5 FileName -api QuickTimeUTC=1 '-FileName<QuickTime:CreateDate' -d '%Y-%m%d-%H%M-%S%%+2nc.%%e' .


To shift movie and image metadata dates, choose GraphicConverter > File > Browse... > [select folder] > [select files] > Camera menu > Modify Exif Date > Shift the Exif Date... > [select desired time shift], Additional options > Set the file creation/modification date, (optional: Set Exif date/time modified, Set Exif date/time digitized etc), Set movie tags (MOV, MP4, M4V and MTS only), Use UTC.


To shift movie metadata dates +0 years, 0 months 0 days 1 hours 2 minutes 3 seconds can be done in exiftool with the following command:


exiftool -m -overwrite_original -api LargeFileSupport=1 -api QuickTimeUTC=1 '-QuickTime:Time:All+=0:0:0 01:02:03' '-FileCreateDate+=0:0:0 01:02:03' '-FileModifyDate+=0:0:0 01:02:03' movie.mp4


You can also type another date to the filenames until they sort correctly in Finder's alphabetical list view, and then adjust the internal metadata dates accordingly:


So, in the opposite direction: to copy filenames to metadata dates in movies and images choose GraphicConverter 12 > File > Browse... > [select folder] > [select files] > Camera menu > Set Exif Date to > Filename... > 'Match string' GC default: YYYY-MM-DD hh.mm.ss (or almost anything you prefer -- I use YYYY-MMDD-hhmm-ss), Additional options > Set the file creation/modification date, (optional: Set Exif date/time modified, Set Exif date/time digitized etc), Set movie tags (MOV, MP4, M4V and MTS only), Use UTC.


To copy filenames to movie metadata dates can be done in exiftool with the following command with a filename like YYYY-MMDD-hhmm-ss:


exiftool -m -overwrite_original -wm w -api LargeFileSupport=1 -api QuickTimeUTC=1 '-AllDates<FileName' '-Track*Date<FileName' '-Media*Date<FileName' '-Keys:CreationDate<FileName' '-FileCreateDate<FileName' '-FileModifyDate<FileName' .


To copy movie and image internal metadata dates to file system creation and modification dates choose GraphicConverter 12 > File > Browse... > [select folder] > [select files] > Calendar menu > Date > Set File Creation and Modification Date with Exif Date.


GPS can be pasted formatted as '-36.6101, -66.91515, 119.9' (latitude, longitude, optional altitude without quotes) from GraphicConverter Browser via Edit > Paste GPS, and copied via Edit > Copy > Copy GPS Position and Altitude for Paste.


To paste GPS to movie metadata can be done in exiftool with the following command:


exiftool -m -P -overwrite_original_in_place -api LargeFileSupport=1 -Keys:GPSCoordinates='-36.6101, -66.91515, 119.9' movie.mp4


BTW, notice that Google Photos might not show 'Keys:GPSCoordinates' locations if there are more than 5 decimals in decimal degrees DD. So truncate the numbers if that is the case. A value in 4 decimal places is accurate to 11.1 meters (±5.55 m), and a value in 5 decimal places is accurate to 1.11 meter at the equator (earth radius 6378137 m, circumference 40075016.7 m, 1° 111319.5 m, 4 decimals 11.1 m, 5 decimals 1.11 m).


In addition to dates and GPS, GraphicConverter 12 can also edit Title, Author, Rating, Keywords, and Description movie tags via its Browser > Edit File Info (IPTC/XMP) > One selected image at a time... [Command-I] or All selected images... [Control-Option-Command-I] (do not use comma (,) in Keywords because it is used as a Keyword separator). Photos displays them via its Window > Info dialog (Title overrides HeadLine (a.k.a. DisplayName) if both exist):


[Keys]          Title                           : Title
[Keys]          DisplayName                     : Headline
[Keys]          Author                          : Author
[Keys]          Keywords                        : Keyword 1,Keyword 2
[Keys]          Description                     : Description


Those tags can also displayed in QuickTime Player.app > Window > Show Movie Inspector [Command-I], and in Finder > View > Show Preview > Show More > in the right side panel.


To paste GPS, Title, Author, Rating, Keywords, and Description to movie metadata can be done in exiftool with the following command (GraphicConverter can display also the Rating):


exiftool -m -P -overwrite_original_in_place -api LargeFileSupport=1 -Keys:GPSCoordinates='-36.6101, -66.91515, 119.9' -Keys:Title='Title' -Keys:Author='Author' -Keys:UserRating=3 -Keys:Keywords='Keyword 1,Keyword 2' -Keys:Description='Description' movie.mp4


------------------------------------------------------------------------


Images:


macOS 13-14 Ventura-Sonoma Photos.app prioritizes sorting imported images like .jpg in the same manner as movies although the metadata tags are different.


1. Image's internal metadata 'ExifIFD:DateTimeOriginal' sets the date and time. If it is not present, there are numerous other internal metadata tags that might set the time. If none of those internal metadata dates exist, then as a last resort Photos grabs the date from macOS file system 'MacOS:FileCreateDate' (social media sites like Facebook, WhatsApp etc strip internal metadata from images and movies). Modifying an image usually changes macOS file system 'System:FileModifyDate' but Photos ignores that date when importing anyway.


In both cases image's time zone is set using the computer's time zone location (standard time New York EST -05:00, Berlin +01:00, for example) when the image is imported to Photos library. DST for that date is also automatically set (daylight saving time New York EDT -04:00, Berlin +02:00, for example).


Also macOS file system 'MacOS:FileCreateDate' time changes depending on the computer's time zone location in a similar manner. File system time stamps are similar to the QuickTime time stamps: they are basically UTC, but the computer automatically shows you the time adjusted to the computer's local time zone. It is best to set the date to the internal metadata dates because file dates are fragile.


Changing the computer to another time zone preserves the time and time zone in the previously imported images.


If present, the following internal metadata tags override previously mentioned time zone, and they might affect sorting up to ±12 hours if they happen to be present in some image:


2. 'GPS' location sets the time zone. Notice that the time zone might be different in the same longitude depending on the latitude. For example, Dhaka in Bangladesh is +06:00 while the same longitude in China is +08:00.


3. If 'ExifIFD:OffsetTimeOriginal' exists, it overrides all other time zone tags above. BTW some iOS ~13.2.2 and later devices do not have GPSTimeStamp anymore, only GPSDateStamp, and the GPSTimeStamp offset is moved to 'OffsetTime*' tags. Photos ignores the similar 'OffsetTime' and 'OffsetTimeDigitized' tags that are often also present.


'ExifIFD:DateTimeOriginal' and GPS can be checked in macOS Finder > Show Preview > Show More > 'Content Created' date in the right side panel. Or in Preview.app > Tools > Show Inspector > i > Exif > 'Date Time Original' field which shows also the possible Time Zone info -- GPS info is also in that dialog.


Those relevant image date tags can be checked in more detail with GraphicConverter > File > Browse... > [select folder] > [select file] > i [at lower right] > ExifTool tab.


Or with an exiftool command below (use a period '.' instead filename to check all files in that folder):


exiftool -a -G1 -s -n -fileOrder5 FileName -FileCreateDate -FileModifyDate -GPSDateTime -ModifyDate -DateTimeDigitized -CreateDate -DateCreated -DateTimeOriginal -GPSPosition -OffsetTimeOriginal image.jpg

[MacOS]         FileCreateDate                  : 2001:01:01 12:00:00-05:00
[System]        FileModifyDate                  : 2001:01:01 12:00:00-05:00
[XMP-exif]      GPSDateTime                     : 2001:01:01 12:00:00-05:00
[XMP-xmp]       ModifyDate                      : 2001:01:01 12:00:00-05:00
[IFD0]          ModifyDate                      : 2001:01:01 12:00:00
[XMP-exif]      DateTimeDigitized               : 2001:01:01 12:00:00-05:00
[XMP-xmp]       CreateDate                      : 2001:01:01 12:00:00-05:00
[ExifIFD]       CreateDate                      : 2001:01:01 12:00:00
[XMP-exif]      DateTimeOriginal                : 2001:01:01 12:00:00-05:00
[XMP-photoshop] DateCreated                     : 2001:01:01 12:00:00-05:00
[ExifIFD]       DateTimeOriginal                : 2001:01:01 12:00:00
[Composite]     GPSPosition                     : 40.74842 -73.98561
[ExifIFD]       OffsetTimeOriginal              : -05:00

Or with more detail:

exiftool -a -G1 -s -n -fileOrder5 FileName -FileCreateDate -Time:All -Location:All image.jpg

exiftool -a -G1 -s -api RequestAll=2 image.jpg


https://www.lemkesoft.de/en/products/graphicconverter/


https://exiftool.org/


See above how to enable time zone display in Photos.app.


If needed, write internal metadata date and time to a movie or image with GraphicConverter > File > Browse... > [select folder] > [select files] > Camera menu > Set Exif Date to > User Defined Date... > [set date and time] Additional options > Set the file creation/modification date, (optional: Set Exif date/time modified, Set Exif date/time digitized etc), Set movie tags (MOV, MP4, M4V and MTS only), Use UTC.


If needed, after that fixing incorrect sorting it is often easiest to edit 'ExifIFD:OffsetTime*' time zone in selected images because it overrides other time zone tags. It can be added or edited with GraphicConverter 12 > File > Browse... > [select folder] > [select files] > Camera menu > Modify Exif Date > Set Exif Date Time Zone... > Set Time Zone, Overwrite existing time zone values.


Image 'ExifIFD:DateTimeOriginal' time and time zone 'ExifIFD:OffsetTimeOriginal' tags can be added and edited in exiftool with a command like ('AllDates' is a shortcut for the three most commonly used image timestamps 'DateTimeOriginal', 'CreateDate' and 'ModifyDate' (of which there are often duplicates in ExifIFD, IFD0, XMP-exif, and XMP-xmp specific G1 groups a.k.a. more general EXIF, and XMP G0 groups):


exiftool -m -overwrite_original '-AllDates=2001:01:01 12:00:00' '-ExifIFD:OffsetTime*=-05:00' '-FileCreateDate=2001:01:01 12:00:00' '-FileModifyDate=2001:01:01 12:00:00' image.jpg


To copy movie and image metadata dates to filenames, choose GraphicConverter > File > Browse... > [select folder] > [select files] > File > Rename... [Command-E] > Name tab: Change filename: [blank] > Date tab: Add date to filename: Exif date, GC Date format default: YYYY-MM-DD hh.mm.ss (or almost anything you prefer -- I dislike spaces in these filenames so I use YYYY-MMDD-hhmm-ss).


To copy image metadata dates to filenames can be done in exiftool with the following command (filename looks like 2001-0101-1200-00.mp4 and will append _NUM if CreateDate is the same for multiple files):


exiftool -m -P -fileOrder5 FileName '-FileName<ExifIFD:DateTimeOriginal' -d '%Y-%m%d-%H%M-%S%%+2nc.%%e' .


To shift movie and image metadata dates, choose GraphicConverter > File > Browse... > [select folder] > [select files] > Camera menu > Modify Exif Date > Shift the Exif Date... > [select desired time shift], Additional options > Set the file creation/modification date, (optional: Set Exif date/time modified, Set Exif date/time digitized etc), Set movie tags (MOV, MP4, M4V and MTS only), Use UTC.


To shift image metadata dates +0 years, 0 months 0 days 1 hours 2 minutes 3 seconds can be done in exiftool with the following command:


exiftool -m -overwrite_original '-AllDates+=0:0:0 01:02:03' '-FileCreateDate+=0:0:0 01:02:03' '-FileModifyDate+=0:0:0 01:02:03' image.jpg


You can also type another date to the filenames until they sort correctly in Finder's alphabetical list view, and then adjust the internal metadata dates accordingly:


So, in the opposite direction: to copy filenames to metadata dates in movies and images choose GraphicConverter 12 > File > Browse... > [select folder] > [select files] > Camera menu > Set Exif Date to > Filename... > 'Match string' GC default: YYYY-MM-DD hh.mm.ss (or almost anything you prefer -- I use YYYY-MMDD-hhmm-ss), Additional options > Set the file creation/modification date, (optional: Set Exif date/time modified, Set Exif date/time digitized etc), Set movie tags (MOV, MP4, M4V and MTS only), Use UTC.


To copy filenames to image metadata dates can be done in exiftool:


exiftool -m -overwrite_original '-AllDates<FileName' '-FileCreateDate<FileName' '-FileModifyDate<FileName' .


To copy movie and image internal metadata dates to file system creation and modification dates choose GraphicConverter 12 > File > Browse... > [select folder] > [select files] > Calendar menu > Date > Set File Creation and Modification Date with Exif Date.


GPS can be pasted formatted as '-36.6101, -66.91515, 119.9' (latitude, longitude, optional altitude without quotes) from GraphicConverter Browser via Edit > Paste GPS, and copied via Edit > Copy > Copy GPS Position and Altitude for Paste.


To paste GPS to image metadata dates can be done in exiftool with the following command:


exiftool -m -P -overwrite_original_in_place '-GPSLatitude*=-36.6101' '-GPSLongitude*=-66.91515' '-GPSAltitude*=119.9' image.jpg


Or to copy & paste coordinates from Google Maps as '-36.6101, -66.91515' to image metadata for example:


exiftool -m -P -overwrite_original_in_place -Composite:GPSPosition='-36.6101, -66.91515' image.jpg


In addition to dates and GPS, GraphicConverter 12 can also edit Title, Author, Rating, Keywords, and Description image tags via its Browser > Edit File Info (IPTC/XMP) > One selected image at a time... [Command-I] or All selected images... [Control-Option-Command-I] (do not use semicolon (;) or comma (,) in Keywords because they are used as list separators). Photos displays them via its Window > Info dialog:


[XMP-dc]        Title                           : Title
[XMP-photoshop] CaptionWriter                   : Author
[XMP-dc]        Subject                         : Keyword 1, Keyword 2
[XMP-dc]        Description                     : Description
[XMP-xmp]       Rating                          : 3
[IPTC]          ObjectName                      : Title
[IPTC]          Writer-Editor                   : Author
[IPTC]          Keywords                        : Keyword 1, Keyword 2
[IPTC]          Caption-Abstract                : Description


GraphicConverter syncs those overlapping XMP and older legacy IPTC tags.


Photos.app can read both IPTC/XMP tags so it is easiest to write only XMP if exiftool is used for this. So writing Title, Author, Rating, Keywords, and Description to image metadata can be done in exiftool with the following command (To clear old Keywords, use just Subject='', then start to fill the Keyword list again. Numbers are sorted as 10, 11, 8, 9 but there is an option to fix that):


exiftool -XMP-dc:Title='Title' -XMP-photoshop:CaptionWriter='Author' -XMP-dc:Description='Description' -XMP-xmp:Rating=3 -tagsFromFile @ -XMP-dc:Subject -XMP-dc:Subject='Keyword 1;Keyword 2' -api NoDups=1 -execute '-Subject<${Subject;$_=join ";", sort {lc($a) cmp lc($b)} split ";"}' -common_args -P -overwrite_original_in_place -sep ';' image.jpg


Remove a specified image IPTC/XMP Keyword:


exiftool -m -P -overwrite_original_in_place -IPTC:Keywords-='Keyword 2' -XMP-dc:Subject-='Keyword 2' image.jpg


https://exiftool.org/forum/index.php?topic=15567.msg83638#msg83638


------------------------------------------------------------------------


A short exiftool manual:


Using exiftool via the command line is not so difficult as it sounds. Just download the MacOS Package .dmg from exiftool main page and install it via ctrl-click > Open (to bypass the security check for applications that haven't a bought a certificate from Apple. Do not worry: this app is from a trusted developer). Then, for example, put copies of the movies you want to process on the Desktop to a folder named 'movies' (don't put anything else there). Then open Applications > Utilities > Terminal.app, type 'cd ' (notice the space) and drag that 'movies' folder to the Terminal window and press Return to change to that folder (or type 'cd ~/Desktop/movies' followed by Return. '~' means your home folder). Then copy & paste the desired command to the Terminal, press Return, and wait for all files in that folder to be processed. (A dot '.' at the end of a command means 'this folder'. Or alternatively, omit that dot '.' at the end, and instead type the exact name of the file you want to process. Or type just the start of the filename, and then press Tab to use autocomplete and maybe insert '*' to the end, and hit Return to process all files that start with the same letters. Or add '-ext mp4' switch to the command to process only files that have .mp4 suffix (or add '-ext dv' to process .dv files that exiftool does not touch by default). That was a rather clumsy instruction but I guess you get the idea.


https://exiftool.org/


https://news.softpedia.com/news/Fix-OS-X-Error-Application-Can-t-Be-Opened-Because-it-Is-from-an-Unidentified-Developer-407375.shtml


exiftool discussion forum is very active and has good tips if you get stuck. Some common command options:


Single quotes is a good habit to get into using exiftool on Mac/Linux. Use single quotes (') instead of double quotes (") around arguments containing a space or dollar sign ($).


Check dates:


exiftool -a -G1 -s -fileOrder5 FileName -api LargeFileSupport=1 -api QuickTimeUTC=1 -FileCreateDate -Time:All .


Check GPS:


exiftool -a -G1 -s -fileOrder5 FileName -api LargeFileSupport=1 -Location:All -n -ee .


-ver -- show exiftool version number (use v12.76 or later).


-a -G1 -s -- Show duplicate tags (-a), what groups they belong to (-G1) and actual tag names (-s).


https://exiftool.org/faq.html#Q3


https://exiftool.org/index.html#groups


-m -- Ignore minor errors and warnings.


-P -- Preserve file modification date/time.


-n -- No print conversion. By default, extracted values are converted to a more human-readable format, but the -n option disables this conversion, revealing the machine-readable values.


-api QuickTimeUTC=1 -- 'QuickTime' movie time stamps should be stored as UTC and programs should adjust them to the local time (but some older cameras store local time instead presumably because they don't know the time zone). '-api QuickTimeUTC=1' option converts to/from UTC to the local time zone of the computer with DST adjustment for that date. This option only affects QuickTime time stamps (QuickTime:CreateDate etc) and doesn't affect any other date/time tags (Keys:CreationDate, UserData:DateTimeOriginal, XMP, image metadata dates etc).


-AllDates -- Shortcut for the three most commonly used image timestamps 'DateTimeOriginal', 'CreateDate' and 'ModifyDate' (of which there are often duplicates in ExifIFD, IFD0, XMP-exif, and XMP-xmp specific G1 groups a.k.a. more general EXIF, and XMP G0 groups. Not so good for movies because it does not touch 'Keys'). BTW macOS 10.15-12 Catalina-Monterey Photos.app scrambled the year in .mp4 and .m4v to something like '5828963' if there was no time zone in 'Keys:CreationDate' or 'UserData:DateTimeOriginal' but this was fixed in macOS 13 Ventura and later (exiftool -ver 12.13 or later automatically adds time zone unless its -n option is used).


- Some EXIF date tags that are in practice often set essentially to the same time anyway:


ExifIFD:DateTimeOriginal (date/time when original image was taken).

ExifIFD:CreateDate (called DateTimeDigitized by the EXIF spec).

IFD0:ModifyDate (called DateTime by the EXIF spec. It is supposed to be changed whenever the image is modified but in practice that is not done).


ExifIFD:SubSecTimeOriginal (fractional seconds for DateTimeOriginal)

ExifIFD:SubSecTimeDigitized (fractional seconds for CreateDate)

ExifIFD:SubSecTime (fractional seconds for ModifyDate)


ExifIFD:OffsetTimeOriginal (time zone for DateTimeOriginal)

ExifIFD:OffsetTimeDigitized (time zone for CreateDate)

ExifIFD:OffsetTime (time zone for ModifyDate)


-wm w -- only write existing tags (no new tags are created). I use this because I dislike generating overlapping related tags that have basically the same info. But sometimes you want to explicitly add some tag so then omit this option.


-overwrite_original -- Overwrite original by renaming tmp file. exiftool always creates a new output file. The original is not touched unless you specify -overwrite_original (in which case the output file is renamed to replace the original), or -overwrite_original_in_place (in which case the contents of the output file are used to overwrite the original, and the output file is deleted). I recommend using this option unless there is some rare Mac-specific metadata you want to preserve. Finder color tags and XAttrMDItemWhereFroms survive -overwrite_original. But notice that this option deletes MacOS:MDItemFSLabel (i.e. the very lastly added Finder color tag) which GraphicConverter Browser most readily displays. A workaround is to delete and add back the last Finder color tag so it shows in GraphicConverter (or just use -overwrite_original_in_place instead).


-overwrite_original_in_place - Overwrite original by copying tmp file. Mac file type & creator (legacy tags that are not important anymore), label color, icon, Finder flags such as 'Hide extension' 'Stationary pad', other extended attributes (such as XAttr/MDItem) and hard links to the file are preserved. If your files don't have such extended attributes, you can very well use the '-overwrite_original' option which is faster because it has to write the file only once. A drawback with -overwrite_original_in_place option is that with it MacOS:FileCreateDate goes only backwards in time (unless the command is split with -execute option).


https://exiftool.org/forum/index.php?topic=8379.msg80063#msg80063


-api LargeFileSupport=1 -- With large (over ~2GB) files add to the command, if there is 'LargeFileSupport not enabled' message. So it is a good idea to always use it with movies.


https://exiftool.org/exiftool_pod.html


-end-





Comments

Jan 27, 2024 11:37 PM

Very, very useful, Matti Haveri! Thank you for compiling and updating this user tip!


Jan 27, 2024 11:37 PM

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.