* READONLY * FileCreateDate ?

Started by HiTechHiTouch, August 05, 2012, 11:19:02 AM

Previous topic - Next topic

Phil Harvey

Great.  I was thinking that I should have added -exiftoolversion to the command to verify you were running the correct version.

I just tried this on Windows 7 too, and it worked for me. (whew!)

There is no shortcut for the system dates.  You must write them with separate arguments (but you can do this in a single command).  Or you could create a user-defined shortcut.  Note that FileAccessDate is not writable.

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

merrickw

Quote from: Phil Harvey on November 26, 2012, 08:42:27 AM
Note that FileAccessDate is not writable.


I think it is writeable ... I was able to go from:

======== G:/My Documents/My Pictures/2011-10-07 /temp/WP_000549.jpg
[File:System]   FileModifyDate                  : 2012:11:18 19:39:10-05:00
[File:System]   FileAccessDate                  : 2012:11:18 19:53:44-05:00
[EXIF:IFD0]     ModifyDate                      : 2012:11:07 13:13:53
[EXIF:ExifIFD]  DateTimeOriginal                : 2012:11:07 13:13:53
[EXIF:ExifIFD]  CreateDate                      : 2012:11:07 13:13:53


to:

======== G:/My Documents/My Pictures/2011-10-07/temp/WP_000549.jpg
[File:System]   FileModifyDate                  : 2012:11:07 13:13:53-05:00
[File:System]   FileAccessDate                  : 2012:11:07 13:13:53-05:00
[EXIF:IFD0]     ModifyDate                      : 2012:11:07 13:13:53
[EXIF:ExifIFD]  DateTimeOriginal                : 2012:11:07 13:13:53
[EXIF:ExifIFD]  CreateDate                      : 2012:11:07 13:13:53


using only:

exiftool "-filemodifydate<datetimeoriginal"

so ... is that a 'bug' or a 'feature'?

Update: this occurred with version 9.06; 
the same command in 9.07 gives me 0 image files updated.  What happened?  I used to get 2 out of 3 ...


Phil Harvey

OK.  You got me.  But try reading the date/times again and see what happens.

ExifTool does actually write the FileAccessDate when writing the FileModifyDate, but the FileAccessDate should get reset to the current date/time whenever the file is accessed.  So if you read it again it should be the time that you last read the file.  This should be the same for ExifTool 9.06 or 9.07.  However, if you use 9.07 to also write FileCreateDate in the same command, I'm not quite sure what will happen to FileAccessDate.

If you get "0 image files updated" it is likely that the file didn't contain a DateTimeOriginal.

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

merrickw

The files are the same from the 9.06 test vs 9.07; 
DateTimeOriginal is there:

======== G:/My Documents/My Pictures/2011-10-07/temp/IMG_3531.JPG
[File:System]   FileModifyDate                  : 2012:11:25 18:05:32-05:00
[File:System]   FileAccessDate                  : 2012:11:25 18:05:32-05:00
[File:System]   FileCreateDate                  : 2012:11:25 18:05:32-05:00
[EXIF:IFD0]     ModifyDate                      : 2012:11:23 14:30:19
[EXIF:ExifIFD]  DateTimeOriginal                : 2012:11:23 14:30:19
[EXIF:ExifIFD]  CreateDate                      : 2012:11:23 14:30:19

Only 9.07 gives me 0 images updated,
somehow "-filemodifydate<datetimeoriginal" stopped working. 
I don't want to try the new "-filecreatedate<datetimeoriginal" until I understand what happened to that.

Phil Harvey

#19
You're right.  It seems that I broke this somehow in 9.07.  I'll post back when I know more.

- Phil

Edit:  Yup.  Darnit.  I broke the writing of FileModifyDate in 9.07.  I'll release 9.08 a.s.a.p. to fix this. (Probably tomorrow morning.)
...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 ($).

Phil Harvey

ExifTool 9.08 is now available, and should fix the problem of writing FileModifyDate.

Sorry for the inconvenience, and thanks for pointing out this problem.

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

merrickw

Hey, no problem at all!  Thanks for adding the feature.  I was looking for a tool to grab the createdate from my jpgs, mp4s and movs and set the three system dates at once, and now I have it.  Thanks so much for a terrific tool!

Regards.
Merrick

merrickw

Hi - before I leave this topic to rest, I had two more questions:

1 - I see that FileAccessDate gets set the same as FileModifiedDate, when I use -filemodifydate<datetimeoriginal.  Is this a side-effect?  And is this a side-effect I can count on, or should I add an explicit: -fileaccessdate<datetimeoriginal as well?

2 - Time zones - I don't really understand what's happening but it looks like the EXIF dates have no time zone, but once I set the filemodifydate, it's getting a-05:00 appended.  Is that also a side effect? 
(And some of my files have -04:00 appended, perhaps from another program)
Any light on this topic would be great.

Thanks again,
Merrick

Phil Harvey

Hi Merrick,

Quote from: merrickw on November 27, 2012, 12:41:06 PM
1 - I see that FileAccessDate gets set the same as FileModifiedDate, when I use -filemodifydate<datetimeoriginal.  Is this a side-effect?

As I mentioned earlier in this thread, FileAccessDate gets updated to the current date/time whenever the file is accessed.  I haven't made FileAccessDate directly writable for this reason (limited usefulness), however it does get set when writing FileModifyDate.

Quote2 - Time zones - I don't really understand what's happening but it looks like the EXIF dates have no time zone

Correct.

Quotebut once I set the filemodifydate, it's getting a-05:00 appended.

This is not an EXIF tag.  It is information stored in the filesystem, and as such the system timezone applies.

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

merrickw

#24
ok - thanks for the answers.

The only point I would make is my experience shows that the fileaccessdate is not getting the current datetime, but the same as filemodifydate; (which is what I would want).

ie, all system dates end up matching DateTimeOriginal:

======== G:/My Documents/My Pictures/2011-10-07/temp/IMG_3531.JPG
[File:System]   FileModifyDate                  : 2012:11:23 14:30:19-05:00
[File:System]   FileAccessDate                  : 2012:11:23 14:30:19-05:00
[File:System]   FileCreateDate                  : 2012:11:23 14:30:19-05:00
[EXIF:IFD0]     ModifyDate                      : 2012:11:23 14:30:19
[EXIF:ExifIFD]  DateTimeOriginal                : 2012:11:23 14:30:19
[EXIF:ExifIFD]  CreateDate                      : 2012:11:23 14:30:19

Phil Harvey

Right, I agreed with you when you first stated this.  Yes, I write both FileAccessDate and FileModifyDate with the same value when you write FileModifyDate.

But now try reading the file again.  FileAccessDate will have changed.

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

merrickw

Do you mean when I try reading the file with exiftool?  Because when I do FileAccess stays fixed to the DateTimeOriginal.  I get the same results immediately after setting the modifydate and also several minutes later:


======== G:/My Documents/My Pictures/2011-10-07/temp/IMG_3531.JPG
[File:System]   FileModifyDate                  : 2012:11:23 14:30:19-05:00
[File:System]   FileAccessDate                  : 2012:11:23 14:30:19-05:00
[File:System]   FileCreateDate                  : 2012:11:23 14:30:19-05:00
[EXIF:IFD0]     ModifyDate                      : 2012:11:23 14:30:19
[EXIF:ExifIFD]  DateTimeOriginal                : 2012:11:23 14:30:19
[EXIF:ExifIFD]  CreateDate                      : 2012:11:23 14:30:19

Phil Harvey

You're really going to make me drag out the PC and try this myself on Windows, aren't you?  Grrr...

C:\Documents and Settings\Phil\Desktop>exiftool -ver
9.08

C:\Documents and Settings\Phil\Desktop>exiftool a.xmp -artist=me
    1 image files created

C:\Documents and Settings\Phil\Desktop>exiftool a.xmp -system:time:all
File Modification Date/Time     : 2012:11:28 07:21:27-05:00
File Access Date/Time           : 2012:11:28 07:21:27-05:00
File Creation Date/Time         : 2012:11:28 07:21:27-05:00

C:\Documents and Settings\Phil\Desktop>exiftool a.xmp -filemodifydate="2012:10:01 10:30:45"
    1 image files updated

C:\Documents and Settings\Phil\Desktop>exiftool a.xmp -system:time:all
File Modification Date/Time     : 2012:10:01 10:30:45-04:00
File Access Date/Time           : 2012:10:01 10:30:45-04:00
File Creation Date/Time         : 2012:11:28 07:21:27-05:00

C:\Documents and Settings\Phil\Desktop>exiftool a.xmp -system:time:all
File Modification Date/Time     : 2012:10:01 10:30:45-04:00
File Access Date/Time           : 2012:11:28 07:22:22-05:00
File Creation Date/Time         : 2012:11:28 07:21:27-05:00


Just as I said.

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

merrickw

Well, I can't argue with that .... but .... I do get different results on my XP machine; 
Plus, I replicated your test on a Win7 machine, and same thing:


C:\exiftool>exiftool -ver
9.08

C:\exiftool>exiftool a.xmp -artist=me
    1 image files created

C:\exiftool>exiftool a.xmp -system:time:all
File Modification Date/Time     : 2012:11:28 08:17:25-05:00
File Access Date/Time           : 2012:11:28 08:17:25-05:00
File Creation Date/Time         : 2012:11:28 08:17:25-05:00

C:\exiftool>exiftool a.xmp -filemodifydate="2012:10:01 10:30:45"
    1 image files updated

C:\exiftool>exiftool a.xmp -system:time:all
File Modification Date/Time     : 2012:10:01 10:30:45-04:00
File Access Date/Time           : 2012:10:01 10:30:45-04:00
File Creation Date/Time         : 2012:11:28 08:17:25-05:00

C:\exiftool>exiftool a.xmp -system:time:all
File Modification Date/Time     : 2012:10:01 10:30:45-04:00
File Access Date/Time           : 2012:10:01 10:30:45-04:00
File Creation Date/Time         : 2012:11:28 08:17:25-05:00

C:\exiftool>


My access time is not changing - I subsequently checked several times and it stays the same as the modify date.
Maybe there is an OS bug somewhere, but it's working for me, so I don't want to waste any more of your time.

By the way, why is the tool using a timezone of -04:00 when the system uses -05:00?

Phil Harvey

The posix specification states that the file access time should be updated to the current time whenever the file's data is accessed.  Operating systems may or may not conform to this standard.  In this case I wouldn't worry too much if they don't, but I must admit that I am surprised you get a different result on the same system (I was running XP), but ExifTool has nothing to do this this.

The -04:00 / -05:00 timezone difference is due to a change in daylight savings time that occurred on November 4.  Dates before Nov. 4 are -04:00 and dates after Nov. 4 are -05: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 ($).