You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

changing date and time in get info/file info on mac

hi

I know how to change the date and time of a file using terminal's touch command. I used this as an example;

touch -t 202106130700/path of file

My issue is this; it will change modified date and show the correct date when shown in finder's list, however in the get info of the file, the creation date does not change- that is the important part for me to change.


Also in the photos app on the mac- instead of showing the day the photos were created it'll show the date of the photos created but shows up like this 2021 June- 2022 April when I only want it to show the original date of the photos created ie. just 2021 June. (The photos were taken only on the 13th june)


Is there a way to overcome this using terminal without downloading anything or by changing command?

Thanks in advance

Claire.

Posted on May 1, 2022 6:40 AM

Reply
Question marked as Top-ranking reply

Posted on May 1, 2022 2:12 PM

When you change the date in the photos app, the new date is stored in the database. Not the file because the file is always kept unchnaged.


So that you CAN export the file unmodified. If it changed the date, that would be modified.


If you want to export with the changed date you need to export normal (not unmodified original).

Similar questions

11 replies
Question marked as Top-ranking reply

May 1, 2022 2:12 PM in response to clairemissy

When you change the date in the photos app, the new date is stored in the database. Not the file because the file is always kept unchnaged.


So that you CAN export the file unmodified. If it changed the date, that would be modified.


If you want to export with the changed date you need to export normal (not unmodified original).

May 1, 2022 9:13 AM in response to clairemissy

Hi


OK - dates in photos. Photos doesn't use the file creation or modified date at all. It uses the photo captured date in the exif data *within* the file.


And the way it is displayed: When you are seeing a range of dates, it is showing the range for all the thumbnails currently visible in the browser. A couple of examples:


All photos shown on screen are from one date:


Photos shown on screen cover a range of dates:


If you want to see the date for a single photo, select it and open the info pane (CMD-i). Or open it enlarged and the date of that photo is shown at the top of the screen.






Now, given that photos doesn't use the file creation or modified dates, do you still need to change those? If so, what do you need to change them to?

May 1, 2022 1:17 PM in response to clairemissy

You still seem to be mixing up file dates with the exif metadata that describes the image inside the file.


The File metadata is kept in the file system, and represents when that copy of the file is created or modified

The image metadata is kept inside the file, as exif and IPTC data. This won't change when you copy / move the file.


(Depending on your system version, if you export unmodified original from photos, you will usually get a file with the same creation date as the image)


You can also see the two different dates in finder, as shown in the screenshot with finder in column view. This is from an image I exported from photos in july 2019 - so the file has been created and last modified then, but the content creation date is still showing 2011...



However, finder (which is a file manager) can only sort by file dates, not by the photo metadata. You need a photo app for that.

May 1, 2022 1:59 PM in response to TonyCollinet

I didn't realise that but that just leave me more confused. I selected one of the photos that had the incorrect data earlier as I had said, changed it to the date I wanted. I selected the photo- went to export unmodified original for photo and checked the photo's data and although it showed the correct date inside the photos app, if I opened it up on the desktop and went to tools and opened show inspector in preview- the data disappeared and if i opened it in finder, it disappeared there as well and only showed todays date.

The whole point of doing this is so that I could be more organised with my files on my desktop, etc, to have the same information across the system. It seems ridiculous that I have no control over the photo's data or file data. Why is there a need to change data when transferring or exporting files why doesn't it just maintain the original data that was created when the photo was created? I appreciate your help.




with the correct date.






May 1, 2022 2:14 PM in response to clairemissy

I selected one of the photos on the desktop that I had exported from the photos app, went into terminal, executed the touch command and now both the photos app and get info show the correct date as well as finder and preview. It seems a rather tedious and long workaround but ill take it until a quicker solution is found.


Thanks for your help all the same :-)

May 1, 2022 10:02 AM in response to TonyCollinet

Hi Tony,

Thank you for your reply. After looking at your reply, it turns out that some of the metadata were showing incorrect exif/metadata so I changed those in the photos app and now it shows as it should be, a single date and not as a range of dates that I had mentioned before. I was under the assumption that because I had changed the dates and times via terminal beforehand, that those adjusted data would be transferred along with the photos to the photos app but for some reason, it didn't. But at least that's sorted.

I am still having trouble with the get info part that are showing only the correct data in the modified date only. I have read somewhere that if you changed the dates on a file more than once, the creation date will not adjust at all i guess. Hopefully there is a solution somewhere. I need the creation date to show the correct date because its a whole lot of confusion for me when photos get transferred to the mac it just shows the transferred date, and then i can't find them...

Thank you.

May 1, 2022 12:28 PM in response to clairemissy

You seem fluent using the Terminal so you could use exiftool to set and copy metadata date tags:


Set DateTimeOriginal (most important), CreateDate, ModifyDate, FileCreateDate and FileModifyDate to any arbitrary timestamp:


exiftool -m -P -overwrite_original_in_place '-AllDates=2015:01:01 08:00:00' '-FileCreateDate=2015:01:01 08:00:00' '-FileModifyDate=2015:01:01 08:00:00' image.jpg


I prefer to rename all images and movies as YYYY-MMDD-hhmm-ss.jpg. That makes it easy to copy that date to all metadata date tags and vice versa.


Rename files to datestamp (Filename looks like 2014-0101-1200-00.jpg and will append _NUM if DateTimeOriginal is the same for multiple files:


exiftool -fileOrder FileName '-FileName<DateTimeOriginal' -d '%Y-%m%d-%H%M-%S%%lc.%%e' .


Show all metadata date tags:


exiftool -a -G1 -s -api QuickTimeUTC=1 -time:all -api RequestAll=2 .


Movie dates need their own adjustments.


https://exiftool.org

May 1, 2022 12:32 PM in response to Matti Haveri

Hi I did attempt to use exiftool but it’s too complicated for me to understand.

Is it possible for u to do a step by step in layman’s terms exactly how to execute the command for the creation date using exiftool please?

I tried exiftool “createdate”<file name but it doesn’t do anything.

I would have like to use setfile- apparently that’s meant to work as a solution to what I’m looking for but I don’t have enough space on my Mac to install it.

thanks

May 1, 2022 12:44 PM in response to clairemissy

3rd party tools like GraphicConverter can do all those basic metadata date manipulations via GUI. exiftool is only needed for more esoteric tasks.


> I tried exiftool “createdate”<file name but it doesn’t do anything.


Mac and Linux Terminal needs single quotes and the metadata tags must be carefully detailed because there are many overlapping similar tags. There is some learning curve but once you get it it is very powerful.

May 1, 2022 10:29 PM in response to clairemissy

"touch" command modifies only the not-so-important and very fragile file dates, NOT the most important ExifIFD:DateTimeOriginal.


I recommend using a workflow that sets DateTimeOriginal correct (*) and maybe also include the same date in the filename. Then you can quite easily copy it to other metadata like those more fragile file dates, if necessary.


(*) Photos.app always stores the original DateTimeOriginal (if it exists). Photos.app saves modified date to its internal database but you can export that modification via a "regular" .jpg export (or more clumsily by exporting it to a .xmp "sidecar" file with the original .jpg and then joining them with 3rd party tools).

changing date and time in get info/file info on mac

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