Restoring creation/modification dates to original creation date

Started by MerelViVeri, June 06, 2018, 05:15:56 AM

Previous topic - Next topic

MerelViVeri

I'm at a complete loss and 2 hours of scouring the forum and FAQ's haven't gotten me any further.
All I'm trying to do is setting the file's creation and modification date to the original date taken. I moved photo's on my phone from the internal storage to my external micro-SD card but all creation and modification dates have been set to the copy date, which obviously messes up my chronological display in my phone's gallery. I'd have thought this was a reasonably common problem but I can't find the answer anywhere.

I've tried "exiftool "-FileModifyDate<DateTimeOriginal#" imag6091.jpg", which appeared to work, but only within the ExifTool when I asked it to list the data. According to the explorer the dates are still the same. I also keep getting a "bad makernotes offset" error and though I can ignore it with -m, it still doesn't fix my dates. It gives that error every single time (as long as I don't ignore it).

I'm honestly quite frustrated that I can't find the solution anywhere. I don't even know why I had to put the # after DTO but it worked better. I really don't feel like searching anymore, so would anyone be so kind as to give me the command line prompt I should use for setting my file's modification and creation dates to the original date taken? In a way that Windows also displays the right values?

Since my phone apparently uses either the creation of modification date instead of the original date taken to display photos in my gallery I'd like to just change them both, on all copied files. I assume that means changing "imag6091.jpg" to "dir".

Thanks in advance for your help!

Phil Harvey

Maybe try setting FileCreateDate as well as FileModifyDate?

exiftool "-filecreatedate<datetimeoriginal" "-filemodifydate<datetimeoriginal" DIR

(the "#" will have no effect if you aren't using the -d option)

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

MerelViVeri

Hi Phil, thanks for your reply. I just tried the line you gave me (but just on one file, to be safe, it's an expendable one) but it still doesn't work for some reason, and it's really strange. It says '1 file updated', and when I look in Windows Explorer, in the list it still gives the old date as the modify date. If I go to Properties, the 'modified' date is now indeed changed, but if I go to Details the modify date is still the old one. The creation date is still the old one.
I also got the warning again: "Warning: [minor] Bad offset for MakerNotes tag 0x0000 - imag6091.jpg"
Could that have anything to do with it?

I also just tried fixing it with the GUI, and then it also says "1 file hasn't been updated due to an error". I have no idea what MakerNotes is or what the offset is or why it's a problem that there's something wrong with it, or what is wrong with it, but somehow it still doesn't work.

EDIT: in the meantime the creation and modify date have even changed to today. Which brings me no closer, haha. I'm starting to wonder if it's even possible with these files or if I should just give up and deal with having my photos in the wrong order.

Phil Harvey

The "bad offset" warning isn't a problem.

One would think that the old date must exist somewhere else if it still being displayed.  Can you see where with this command?:

exiftool -G1 -a -time:all FILE

(note that the command I gave in my previous post doesn't actually modify the file -- it just updates the filesystem date/times)

Also, this post by StarGeek may be helpful.

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

MerelViVeri

Thanks for getting back to me so quickly! Here's what I got:

[System]        File Modification Date/Time     : 2018:06:06 19:38:02+02:00
[System]        File Access Date/Time           : 2018:06:06 19:38:02+02:00
[System]        File Creation Date/Time         : 2018:06:06 19:38:00+02:00
[IFD0]          Modify Date                     : 2016:10:28 16:59:56
[ExifIFD]       Date/Time Original              : 2016:10:28 16:59:56
[ExifIFD]       Create Date                     : 2016:10:28 16:59:56
[ExifIFD]       Sub Sec Time Original           : 734
[GPS]           GPS Time Stamp                  : 14:59:48
[GPS]           GPS Date Stamp                  : 2016:10:28
[Composite]     GPS Date/Time                   : 2016:10:28 14:59:48Z
[Composite]     Date/Time Original              : 2016:10:28 16:59:56.734

For some reason the modification/acces/creation dates have now shifted to today, they used to be april 30th 2017. Now today's date is what my Windows Explorer is showing in the list as "date modified".

Phil Harvey

After you ran this command:

exiftool "-filecreatedate<datetimeoriginal" "-filemodifydate<datetimeoriginal" FILE

The "File Modification Date/Time" and "File Creation Date/Time" should both be "2016:10:28 16:59:56" (the value of "Date/Time Original").  If not, then we have a problem.

The "File Access Date/Time" is just the last time the file was accessed, and can't be set, but it isn't used by anything.

If you changed the file with ExifTool, then the filesystem date/times will get set to today unless you use the -P option.  But so far in this thread there have been no commands that could do this.  So you need to figure out what did this.

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

MerelViVeri

I ran that last command again, and then I listed the data again:

[System]        File Modification Date/Time     : 2016:10:28 16:59:56+02:00
[System]        File Access Date/Time           : 2018:06:06 19:38:02+02:00
[System]        File Creation Date/Time         : 2018:06:06 19:38:00+02:00
[IFD0]          Modify Date                     : 2016:10:28 16:59:56
[ExifIFD]       Date/Time Original              : 2016:10:28 16:59:56
[ExifIFD]       Create Date                     : 2016:10:28 16:59:56
[ExifIFD]       Sub Sec Time Original           : 734
[GPS]           GPS Time Stamp                  : 14:59:48
[GPS]           GPS Date Stamp                  : 2016:10:28
[Composite]     GPS Date/Time                   : 2016:10:28 14:59:48Z
[Composite]     Date/Time Original              : 2016:10:28 16:59:56.734

I understand that the access date won't change and that doesn't matter of course. The modification date has now changed according to this list, but not the creation date and I'm guessing that's the one my phone uses to chronologically order the photos. The strange thing is that in Windows Explorer, even after refreshing, the 'Date Modified' is still today's date. 'Created' and 'Modified' are both set to today in Properties, and in the details. If I then list the dates again using that command you gave me, I get this:

[System]        File Modification Date/Time     : 2018:06:06 19:38:02+02:00
[System]        File Access Date/Time           : 2018:06:06 19:38:02+02:00
[System]        File Creation Date/Time         : 2018:06:06 19:38:00+02:00
[IFD0]          Modify Date                     : 2016:10:28 16:59:56
[ExifIFD]       Date/Time Original              : 2016:10:28 16:59:56
[ExifIFD]       Create Date                     : 2016:10:28 16:59:56
[ExifIFD]       Sub Sec Time Original           : 734
[GPS]           GPS Time Stamp                  : 14:59:48
[GPS]           GPS Date Stamp                  : 2016:10:28
[Composite]     GPS Date/Time                   : 2016:10:28 14:59:48Z
[Composite]     Date/Time Original              : 2016:10:28 16:59:56.734

The modification date has been set to today again... I'm terribly confused. Unfortunately my knowledge of metadata and stuff like this isn't broad enough to figure out what's going wrong.

Phil Harvey

There is some other software messing with these files.  I suspect an overactive virus scanner.

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