Hello,
I am not computer stupid but not a genius when it comes to using command lines on my mac computer. I exported a video from my iPhone to my mac and am trying to edit the ORIGINAL video date and time (DateTimeOriginal). The video for some reason showed the date of October 26, 2016 but I want to change it to last nights date (11-26-2019). I did some googling and use this command line to change the DateTimeOriginal so it would reflect on my iPhone as well and it said one image was updated once I hit the command line in terminal. I checked to see if it was updated in terminal after that by using the command line -exiftool -a /Users/Kaden/Downloads/IMG_4670 it showed the image information and it indeed was changed. However, I finally export it back to my phone using AirDrop from my Mac and then view the date and time on the iPhone and on the top it says December 31, 1969. What am I doing wrong? How do I go about changing the DateTimeOriginal so it reflects on all devices.
The command line I used to update the DateTimeOriginal is:
exiftool -AllDates='2019:11:26 23:48:52' -overwrite_original /Users/Kaden/Downloads/IMG_4670.mp4
The AllDates shortcut applies only to command EXIF date/time tags, but you are writing an MP4 file which uses other date/time tags. To see them all, use -time:all. Also, add -api quicktimeutc because I think the iPhone likely stores UTC times (since it knows the time zone). So first try this command to see what the original file contains:
exiftool -api quicktimeutc -time:all -a -G1 FILE
To change all of these, do this:
exiftool -api quicktimeutc -wm w -time:all="2019-11-26 2019:11:26 23:48:52" FILE
The -wm w here sets the write mode to write only pre-existing tags (ie. don't create new ones).
You may also want to set the FileModifyDate by adding this to the command:
-filemodifydate="2019-11-26 2019:11:26 23:48:52"
Also, be sure you are using a recent version of ExifTool since older versions may not be able to write some MP4 tags.
- Phil
Wow, thank you for the quick and fast reply. I appreciate you helping me get this fixed. I ran all the commands except the last one only because it wasn't working. I then imported it back to my iPhone and now the date it set to a date in. The date shows as (October 18, 1048578). I have attached a image of what I typed into the terminal.
I meant to do this to also set FileModifyDate:
exiftool -api quicktimeutc -wm w -time:all="2019-11-26 2019:11:26 23:48:52" -filemodifydate="2019-11-26 2019:11:26 23:48:52" FILE
But I don't understand how the iPhone could show a year of "1048578".
After the above command, re-run this command to see all of the new dates to make sure everything looks OK:
exiftool -api quicktimeutc -time:all -a -G1 FILE
- Phil
I copied and pasted the line that you posted in the last reply followed by dragging and dropping the video in the terminal after and it said the file was updated. I then ran the command and this is what the terminal showed:
[System] File Modification Date/Time : 2019:11:26 20:19:11-05:00
[System] File Access Date/Time : 2019:11:26 20:19:11-05:00
[System] File Inode Change Date/Time : 2019:11:27 10:54:06-05:00
[QuickTime] Create Date : 2019:11:26 20:19:11-05:00
[QuickTime] Modify Date : 2019:11:26 20:19:11-05:00
[Track1] Track Create Date : 2019:11:26 20:19:11-05:00
[Track1] Track Modify Date : 2019:11:26 20:19:11-05:00
[Track1] Media Create Date : 2019:11:26 20:19:11-05:00
[Track1] Media Modify Date : 2019:11:26 20:19:11-05:00
[UserData] Date/Time Original : 2019:11:26 20:19:11
[XMP-exif] Date/Time Original : 2019:11:26 20:19:11
[XMP-xmp] Create Date : 2019:11:26 20:19:11
[XMP-xmp] Modify Date : 2019:11:26 20:19:11
I transferred the video to my iPhone again, and now the date is changed again to December 31,1969. The month and the year got changed. I also noticed the timestamp shown above is off as well from the timestamp we set when running the command.
My mistake. Cut and paste error. Sorry. I should have paid attention to the date/time value. Try this:
exiftool -api quicktimeutc -wm w -time:all="2019:11:26 23:48:52" -filemodifydate="2019:11:26 23:48:52" FILE
- Phil
Wow that did it, could you explain to me what was being done incorrectly before. In the future if I ever need to change the date of anything on my iPhone I can just run that command (but change the date and time) and it should be good?
Thank you so much. :)
I had an error in my date/time formatting:
"2019-11-26 2019:11:26 23:48:52"
it should have been
"2019:11:26 23:48:52"
I tried to send the video to another iPhone and now it's doing the same thing it changed the date and time to a weird one (December 31,1969). I ran the same line that worked successfully for us the last time and it is still displaying the same results. Do you know what might seem to be the same issue. I sent the video AirDrop to another iPhone of mines (not the same one that worked last time).
Are all of the dates in the file correct? If so, then there is something weird going on with how the iPhone gets the date/time.
- Phil
Yes, the dates in the file are correct. I ran the lines you mentioned above to view the time and stamp and this is what it shows:
[System] File Modification Date/Time : 2019:11:26 23:48:52-05:00
[System] File Access Date/Time : 2019:11:26 23:48:52-05:00
[System] File Inode Change Date/Time : 2019:11:29 08:39:06-05:00
[QuickTime] Create Date : 2019:11:26 23:48:52-05:00
[QuickTime] Modify Date : 2019:11:26 23:48:52-05:00
[Track1] Track Create Date : 2019:11:26 23:48:52-05:00
[Track1] Track Modify Date : 2019:11:26 23:48:52-05:00
[Track1] Media Create Date : 2019:11:26 23:48:52-05:00
[Track1] Media Modify Date : 2019:11:26 23:48:52-05:00
[UserData] Date/Time Original : 2019:11:26 23:48:52
I had ran the same exact line that we ran previously to change the date (the last one with the corrected values) and it is throwing off the date. The date and year now show December 31, 1969.
I'm out of ideas here. It looks like ExifTool is doing its job. I hate to suggest it, but maybe an iPhone forum is the place to ask this question.
- Phil
try writing the date without the time zone specifier? The video assets I saw didn't include the time zone specifier.
Unfortunately apple photo library software silently fails on situations like that instead of reporting that the QuickTime:MediaCreateDate might be formatted wrong
Quote from: AndrewSB on December 05, 2019, 08:34:29 PM
try writing the date without the time zone specifier? The video assets I saw didn't include the time zone specifier.
Doctorwhoson is probably using the
-api QuickTimeUTC option (https://exiftool.org/ExifTool.html#QuickTimeUTC) mentioned in Phil's first post in this thread. Without that option, exiftool displays the time as listed in the file. With it, it adjusts the time to local time of the computer and shows the time zone difference.
Example output:
C:\>exiftool -g1 -a -s -createdate y:/!temp/Test1.mp4
---- QuickTime ----
CreateDate : 2019:10:23 04:10:32
C:\>exiftool -g1 -a -s -createdate y:/!temp/Test1.mp4 -api QuickTimeUTC
---- QuickTime ----
CreateDate : 2019:10:22 21:10:32-07:00