"AllDates" represent not the main times in any way

Started by Jens0079, December 31, 2013, 08:31:37 AM

Previous topic - Next topic

Jens0079

Hi!

The shortcut "AllDates" represent "DateTimeOriginal","CreateDate"and "ModifyDate".
With that I adjust the time of Photos. For know exiftool can write the time of ".mov" files. Thanks for that! When I analyse a 17s mov file from my iPhone I found the following time tags:

[System]        FileModifyDate                  : 2013:01:06 18:08:22+01:00
[System]        FileAccessDate                  : 2013:12:30 21:07:17+01:00
[System]        FileInodeChangeDate             : 2013:12:30 20:38:04+01:00
[QuickTime]     CreateDate                      : 2013:01:06 17:08:22
[QuickTime]     ModifyDate                      : 2013:01:06 17:08:35
[Track1]        TrackCreateDate                 : 2013:01:06 17:08:22
[Track1]        TrackModifyDate                 : 2013:01:06 17:08:35
[Track1]        MediaCreateDate                 : 2013:01:06 17:08:22
[Track1]        MediaModifyDate                 : 2013:01:06 17:08:35
[Track2]        TrackCreateDate                 : 2013:01:06 17:08:22
[Track2]        TrackModifyDate                 : 2013:01:06 17:08:35
[Track2]        MediaCreateDate                 : 2013:01:06 17:08:22
[Track2]        MediaModifyDate                 : 2013:01:06 17:08:35
[QuickTime]     CreateDate-deu                  : 2013:01:06 18:08:22+01:00
[QuickTime]     CreationDate-deu-DE             : 2013:01:06 18:08:22+01:00

There is no "DateTimeOriginal" and CreateDate or ModifyDate represent not the time I set here in germany. The right tag for my time is "CreateDate-deu" or "CreationDate-deu-DE"
Photos from my iPhone have the right time tag like other photos in "ModifyDate", "DateTimeOriginal", "CreateDate" so everything works fine with "AllDates"

Maybe you have to think about the Shortcut "AllDates" because movies are a little different in timetags. When people in different countries use this in hope it works, they adjust the wrong time tag for this movies.

Jens
macOS Sierra

Phil Harvey

Hi Jens,

The "AllDates" shortcut isn't meant to represent all date/time tags for all file formats.  So from this point of view, the tag name is misleading.  I don't think it is realistic to try to create a shortcut that covers all possible date/time tags.  The best thing would be for you to create your own user-defined shortcut for the tags that you want to write.

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

Jens0079

#2
Hi Phil!

I did it.

%Image::ExifTool::UserDefined::Shortcuts = (
    MyAllDates => ['DateTimeOriginal','CreateDate','ModifyDate','CreateDate-deu','CreationDate-deu-DE','TrackCreateDate','TrackModifyDate','MediaCreateDate','MediaModifyDate'],
);
1; # end

But this does not affect "CreateDate-deu" and "CreationDate-deu-DE" from [QuickTime]. Could there be a problem with the "-" in the tagname? "[QuickTime] CreateDate" has changed.

When I edit these tags directly I get the message
"0 image files updated, 1 image files unchanged" for CreateDate-deu
"Warning: Tag 'CreationDate' does not support alternate languages, Nothing to do" for CreationDate-deu-DE

-Jens
macOS Sierra

Phil Harvey

Hi Jens,

Quite right.  Sorry, I should have mentioned this.  ExifTool can not yet write these tags.  If it could, your syntax would be correct.  See the QuickTime tags documentation to see which tags are writable.  The tags you can't write are probably in the UserData or Keys information which isn't currently 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 ($).

Jens0079

Hi Phil and a Happy New Year!

In contrast to my Fuji X10 where the time is stored in the following tags everything which is important for me in germany is changeable. So I can change time for these movies.
But with the iPhone the important time for me in Germany is stored in not writeable tags. So it seems that it is not workable for me to change the time for iPhone movies.
You write something from UTC and the Option to set the UTC option in the configuration file. I can't find any information how to set it.
Can you tell me if I am right that the important time for me is in these not writable tags only. Or has it something to do with the UTC option?

Fuji X10 Movie Output

[System]        FileModifyDate                  : 2013:05:19 12:27:02+02:00
[System]        FileAccessDate                  : 2014:01:01 10:09:06+01:00
[System]        FileInodeChangeDate             : 2014:01:01 10:09:03+01:00
[QuickTime]     CreateDate                      : 2013:05:19 12:27:26
[QuickTime]     ModifyDate                      : 2013:05:19 12:27:26
[Track1]        TrackCreateDate                 : 2013:05:19 12:27:26
[Track1]        TrackModifyDate                 : 2013:05:19 12:27:26
[Track1]        MediaCreateDate                 : 2013:05:19 12:27:26
[Track1]        MediaModifyDate                 : 2013:05:19 12:27:26
[Track2]        TrackCreateDate                 : 2013:05:19 12:27:26
[Track2]        TrackModifyDate                 : 2013:05:19 12:27:26
[Track2]        MediaCreateDate                 : 2013:05:19 12:27:26
[Track2]        MediaModifyDate                 : 2013:05:19 12:27:26
[IFD0]          ModifyDate                      : 2013:05:19 12:26:45
[ExifIFD]       DateTimeOriginal                : 2013:05:19 12:26:45
[ExifIFD]       CreateDate                      : 2013:05:19 12:26:45


-Jens
macOS Sierra

Phil Harvey

Hi Jens,

I should have thought about writing -time:all before now.  This writes all tags in the Time group, which does what you wanted to do initially without a shortcut tag.  (I didn't think about this because it is a recent addition.  You need ExifTool 9.40 or later to specify a family 2 group name when writing.)  It still won't write all the tags in your iPhone videos though.

Quote from: Jens0079 on January 01, 2014, 04:47:41 AM
You write something from UTC and the Option to set the UTC option in the configuration file. I can't find any information how to set it.
Can you tell me if I am right that the important time for me is in these not writable tags only. Or has it something to do with the UTC option?

You mean the QuickTimeUTC option?  You can set this via the config file (see the user-defined Options in the sample config file for an example), or via the command line with the -api option (case sensitive):

exiftool -api QuickTimeUTC ...

or

exiftool -api QuickTimeUTC=1 ...

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

Jens0079

#6
Hi Phil

I only used -time:all for extracting all time tags before. But up to know I think it could replace -AllDates. I dont't know any time tag that should not be changed to correct time issues.

Yes I mean the QT-UTC Option. Currently I try to understand the time tags.
Like your description from the QT specification all time tags should be stored in UTC. When writing this, it means TIME (+00:00). In the specification of QT is nothing to read about the offset. There is only an example of a date
Quote"2012-02-24T17:56Z" for a date of February 24, 2012, time of 17:56, UTC.
Nothing about that it has to be in (+00:00) In wikipedia I found that a time in UTC (+00:00) has to be defined with this offset also. Not only write this time without an offset and think it should be UTC.

Question

  • Where is the specifikation that times has to be UTC (+00:00) in Quicktime? Or am I wrong?
  • Where is the information stored in the metadata in which timezone the picture was taken so the option -api QuickTimeUTC=1 can calculate the right local time?
  • Why is the output of some dates in my files with -api QuickTimeUTC=0 without the offset and some files have the offset like "CreateDate-deu"?
  • Why have some dates no offset when I use -api QuickTimeUTC=1

iPhone movie with QuickTimeUTC=0 (the right local time is 2014:01:02 12:58:55)

[System]        FileModifyDate                  : 2014:01:02 12:59:04+01:00
[System]        FileAccessDate                  : 2014:01:03 13:58:42+01:00
[System]        FileInodeChangeDate             : 2014:01:02 12:59:36+01:00
[QuickTime]     CreateDate                      : 2014:01:02 11:58:55
[QuickTime]     ModifyDate                      : 2014:01:02 11:59:03
[Track1]        TrackCreateDate                 : 2014:01:02 11:58:55
[Track1]        TrackModifyDate                 : 2014:01:02 11:59:03
[Track1]        MediaCreateDate                 : 2014:01:02 11:58:55
[Track1]        MediaModifyDate                 : 2014:01:02 11:59:03
[Track2]        TrackCreateDate                 : 2014:01:02 11:58:55
[Track2]        TrackModifyDate                 : 2014:01:02 11:59:03
[Track2]        MediaCreateDate                 : 2014:01:02 11:58:55
[Track2]        MediaModifyDate                 : 2014:01:02 11:59:03
[QuickTime]     CreateDate-deu                  : 2014:01:02 12:58:55+01:00
[QuickTime]     CreationDate-deu-DE             : 2014:01:02 12:58:55+01:00


Fuji movie with QuickTimeUTC=1 (the right local time is 2013:03:03 19:52:50)

[System]        FileModifyDate                  : 2013:03:03 19:53:46+01:00
[System]        FileAccessDate                  : 2014:01:03 11:27:10+01:00
[System]        FileInodeChangeDate             : 2013:10:24 21:27:39+02:00
[QuickTime]     CreateDate                      : 2013:03:03 20:54:11+01:00
[QuickTime]     ModifyDate                      : 2013:03:03 20:54:11+01:00
[Track1]        TrackCreateDate                 : 2013:03:03 20:54:11+01:00
[Track1]        TrackModifyDate                 : 2013:03:03 20:54:11+01:00
[Track1]        MediaCreateDate                 : 2013:03:03 20:54:11+01:00
[Track1]        MediaModifyDate                 : 2013:03:03 20:54:11+01:00
[Track2]        TrackCreateDate                 : 2013:03:03 20:54:11+01:00
[Track2]        TrackModifyDate                 : 2013:03:03 20:54:11+01:00
[Track2]        MediaCreateDate                 : 2013:03:03 20:54:11+01:00
[Track2]        MediaModifyDate                 : 2013:03:03 20:54:11+01:00
[IFD0]          ModifyDate                      : 2013:03:03 19:52:50
[ExifIFD]       DateTimeOriginal                : 2013:03:03 19:52:50
[ExifIFD]       CreateDate                      : 2013:03:03 19:52:50

-Jens
macOS Sierra

Phil Harvey

Hi Jens,

Quote from: Jens0079 on January 03, 2014, 09:59:48 AM
1. Where is the specifikation that times has to be UTC (+00:00) in Quicktime? Or am I wrong?

Quoting from this reference:

https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/QTFFChap4/qtff4.html#//apple_ref/doc/uid/TP40000939-CH206-TPXREF101

        It is strongly recommended that all calendar date and time values be stored using
        UTC time, so that all files have a time and date relative to the same time zone.


however, it does also state

        Common practice is to use local time for the time zone where the value is generated

Quote2. Where is the information stored in the metadata in which timezone the picture was taken so the option -api QuickTimeUTC=1 can calculate the right local time?

        This value does not specify a time zone.

So ExifTool uses the current system time zone.

Quote3. Why is the output of some dates in my files with -api QuickTimeUTC=0 without the offset and some files have the offset like "CreateDate-deu"?
4. Why have some dates no offset when I use -api QuickTimeUTC=1

The user-data and EXIF date/time values are stored as a string instead of an integer, so they are converted differently.

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

Jens0079

Hi Phil,

For calender I realise the UTC time escpecially for pilots. But in the fact that there is no timezone stored in the metadata of pictures all dates should be saved in local time. The Apple specification differs between calender dates and movie dates like your description.

When I write out -time:all your Output of exiftool will display times without offset and times with offset. I don't know the core time in the file for the different tags which I can't see and what exiftool does with that time.
Is it right that my maker store some dates in UTC and some other dates in local time? Or are all dates local time and exiftool modify this dates?

I don't know how it can work when there is no information about the timezone in the file. How do programs know the right time of a picture?

-Jens
macOS Sierra

Phil Harvey

Quote from: Jens0079 on January 03, 2014, 04:29:05 PM
I don't know the core time in the file for the different tags which I can't see and what exiftool does with that time.

You can use the -v option to see the raw value for all of the tags.

QuoteIs it right that my maker store some dates in UTC and some other dates in local time? Or are all dates local time and exiftool modify this dates?

The specification is not specific enough for me to answer this question.  You would have to ask the people who wrote the software that created this file.

QuoteI don't know how it can work when there is no information about the timezone in the file. How do programs know the right time of a picture?

They don't.  And it isn't only MOV files that have this problem.  There is no way to specify a time zone within the EXIF specification either.  When someone made a suggestion to an EXIF committee member regarding addition of a time zone, the response was: "Why would anyone want that?".  Such is the world of metadata standards.

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

Jens0079

Hi Phil,

thanks for the -v option. This helps me a lot.

Tagname                      Output of Exiftool                            Tagname (-v)             Output of Exiftool (-v)

FileModifyDate : 2014:01:02 12:59:04+01:00 FileModifyDate : 1388663944
FileAccessDate : 2014:01:04 11:21:52+01:00 FileAccessDate : 1388830973
FileInodeChangeDate : 2014:01:02 12:59:36+01:00 FileInodeChangeDate : 1388663976
CreateDate : 2014:01:02 11:58:55 CreateDate : 3471508735
ModifyDate : 2014:01:02 11:59:03 ModifyDate : 3471508743
TrackCreateDate : 2014:01:02 11:58:55 TrackCreateDate : 3471508735
TrackModifyDate : 2014:01:02 11:59:03 TrackModifyDate : 3471508743
MediaCreateDate : 2014:01:02 11:58:55 MediaCreateDate : 3471508735
MediaModifyDate : 2014:01:02 11:59:03 MediaModifyDate : 3471508743
TrackCreateDate : 2014:01:02 11:58:55 TrackCreateDate : 3471508735
TrackModifyDate : 2014:01:02 11:59:03 TrackModifyDate : 3471508743
MediaCreateDate : 2014:01:02 11:58:55 MediaCreateDate : 3471508735
MediaModifyDate : 2014:01:02 11:59:03 MediaModifyDate : 3471508743
CreateDate-deu : 2014:01:02 12:58:55+01:00 CreateDate : ...2014-01-02T12:58:55+0100
CreationDate-deu-DE : 2014:01:02 12:58:55+01:00 CreationDate-deu-DE : 2014-01-02T12:58:55+0100


So the time is stored in seconds since 1970 for the first three system entries with unix time stamp and in seconds since 1904 Mac time stamp for the other without the last two.

Question

  • Why displays exiftool the systemdates in local time with adding my timezone specific offset but converting the time (exactly the seconds) of the other exif tags back to UTC (+0000)
  • I can't find the tagname "CreateDate-deu" in raw output. Instead of this there is another "CreateDate" How has this been created with the "-deu" at the end?
  • Is it right that the last two entries are not stored in seconds from a base date? Are they stored at the extended format of the Quicktime specification? The iPhone should know my timezone.
  • All my cameras like iPhone and Fuji stored dates in seconds from a base date. So it is always the local time in these pictures that I enter for my timezone in the camera. With that is it helpful to make the QuickTimeUTC=1 to the default? Or can I have any problems with that?
  • Why is QuickTimeUTC=1 not default when all cameras because of the missing timezone tag for the metadata store local times
macOS Sierra

Phil Harvey

Quote from: Jens0079 on January 04, 2014, 06:00:31 PM
1. Why displays exiftool the systemdates in local time with adding my timezone specific offset but converting the time (exactly the seconds) of the other exif tags back to UTC (+0000)

I don't understand your question exactly.  For times stored as seconds since some start time, ExifTool must assume some time zone for the start time to be able to display the time properly.

Quote2. I can't find the tagname "CreateDate-deu" in raw output. Instead of this there is another "CreateDate" How has this been created with the "-deu" at the end?

Now we are getting into some esoteric details of how ExifTool decodes QuickTime information.  The QuickTime UserData tags are a bit different.  The language is stored in the tag value and not the tag name.  ExifTool handles this internally by appending the language to the tag name.  The language code is in the 3 bytes before the tag value, but they are shown as "..." because they are not printable.  Use the -v3 option to see the hex value of these bytes.

Quote3. Is it right that the last two entries are not stored in seconds from a base date? Are they stored at the extended format of the Quicktime specification?

The last 2 dates are stored as a string.  Use the -v3 option to see the raw bytes in hex.

QuoteAll my cameras like iPhone and Fuji stored dates in seconds from a base date.

Yes, but what time zone is the base date in?

QuoteWith that is it helpful to make the QuickTimeUTC=1 to the default? Or can I have any problems with that?

I can't answer this until you answer my last question.

QuoteWhy is QuickTimeUTC=1 not default

I have seen dates stored relative to both UTC and local time zero.  I set the default according to the case I saw most frequently.

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

Jens0079

QuoteFor times stored as seconds since some start time, ExifTool must assume some time zone for the start time to be able to display the time properly.
But why do you assume for the standard exiftool output for filesystem tags like "FileModifyDate" or "FileAccessDate" which are stored in seconds, the Offset from my system (+01:00 for germany) and the other times that are stored in seconds like "ModifyDate" or "TrackCreateDate" you assume +00:00? Both is right and show me the right time but the display is different.

QuoteThe language code is in the 3 bytes...
Thank you for explanation.

QuoteThe last 2 dates are stored as a string.
Thanks. Now I know why there is always the offset shown. It is saved in the string for this dates/times. You have nothing to calculate. Just display the string. Or change the Mac extended date/time format in more readable format.

QuoteYes, but what time zone is the base date in?
Oh, I don't mean the timezone. I mean 1904 or 1970 with the "Base date" (you write it with "start time") Sorry.

Quote
Q: With that is it helpful to make the QuickTimeUTC=1 to the default? Or can I have any problems with that?
A: I can't answer this until you answer my last question.
I mean you get the information for filesystem dates/times like "FileModifyDate" in seconds and you transfer this in my local time (+01:00)
You get the information for exif dates/times like "TrackCreateDate" in seconds also but convert it to UTC time.
Why do you do convert it different? So with the option QuickTimeUTC=1 all date/times which are stored in seconds are displayed at my local time.

QuoteI have seen dates stored relative to both UTC and local time zero.  I set the default according to the case I saw most frequently.
I think it is not a question of which is the relative time for the seconds in the metadata. All you have is seconds. You handle all dates like they are local times. Filesystem dates/times and exif dates /times. The different is how you display these dates/times. I write it in my first comment.

-Jens
macOS Sierra

Phil Harvey

Hi Jens,

Quote from: Jens0079 on January 05, 2014, 05:35:53 AM
But why do you assume for the standard exiftool output for filesystem tags like "FileModifyDate" or "FileAccessDate" which are stored in seconds, the Offset from my system (+01:00 for germany) and the other times that are stored in seconds like "ModifyDate" or "TrackCreateDate" you assume +00:00? Both is right and show me the right time but the display is different.

I already answered this question (more than once I thought).  Referring to the QuickTime date/time values:

"I have seen dates stored relative to both UTC and local time zero.  I set the default according to the case I saw most frequently."

QuoteOh, I don't mean the timezone. I mean 1904 or 1970 with the "Base date" (you write it with "start time") Sorry.

I know what you meant.   This "base date" is 00:00 on January 1st (either 1904 or 1970).  But 00:00 in what time zone?  That is my point.

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

Jens0079

Hi Phil!

I am very sorry! I think I have some problemns in understanding your words.

You interpret the seconds as they are stored in local time
You display it in timezone +00:00
For that you convert the seconds with the knowing of my system timezone to the timezone +00:00
You do not interpret the seconds as they are UTC time.

Right?

-Jens
macOS Sierra

Phil Harvey

ExifTool displays numerical times in the local system timezone if the absolute time is known and the value doesn't specify a time zone.  A good example of this are the System times.

If the absolute time is not known, then no time zone is displayed.  This is the default for numerical QuickTime date/time tags.

Date/time values stored as strings are not changed, other than some string reformatting to use a consistent date/time format.

I can't see any other reasonable way that ExifTool could handle the date/time tags, so I am confused about why you seem to have problems understanding this, unless it is just a communication 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 ($).

Jens0079

Hi Phil,

QuoteIf the absolute time is not known, then no time zone is displayed.  This is the default for numerical QuickTime date/time tags.
That's the lack of understanding from me.

I thought it is displayed in the timezone +00:00. I thought you doesn't write it because it is zero. (Like 123,000000 = 123)
I tried a Mac time converter from the internet. (http://fmdiff.com/fm/timestamp.html)
3471508735 => 12:58:55 (This is my correct local time for this file). You displays 11:58:55 in exiftool output so I thought you took my system timezone (+01:00) and convert the 3471508735 which represent 12:58:55 back to +00:00 because of the difference of one hour between the time converter and your exiftool output.



-Jens
macOS Sierra

Phil Harvey

For example, this is what I get in my timezone for a sample iPhone 4 video that I have here:

> exiftool ../pics/Apple_iPhone4.mov -createdate -H -a
0x0001 Create Date                     : 2010:06:25 21:50:16
     - Create Date                     : 2010:06:25 17:50:16-04:00

> exiftool ../pics/Apple_iPhone4.mov -createdate -H -a -api QuickTimeUTC
0x0001 Create Date                     : 2010:06:25 17:50:16-04:00
     - Create Date                     : 2010:06:25 17:50:16-04:00

> exiftool ../pics/Apple_iPhone4.mov -v | grep -w CreateDate
  | | CreateDate = 3360347416
  | | CreateDate = ...2010-06-25T17:50:16-0400


So for this video the numerical date/time values are based on UTC time zero, and ExifTool converts the times properly with the QuickTimeUTC 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 ($).

Jens0079

Hi Phil!

Thanks, now I know "my" mistake.
My posted timeconverter link displays your seconds (3360347416) at "Friday, 2010-06-25 23:50:16 (UTC)" That's wrong. This are these seconds in MY timezone. Not at UTC zero like it is displayed in the brackets.
I found another converter which makes it right. http://www.epochconverter.com/epoch/mac-timestamp.php

With that I have the output of 3360347416 seconds

  • GMT: Fri, 25 Jun 2010 21:50:16 GMT
  • Your time zone (my time zone ;)): 25.06.2010 23:50:16
That's right!

So because of the wrong output from the first converter I thought the time is saved at "local time" and you convert it back to UTC zero.

Now I understand your output of the times. And for my cameras (iPhone, Fuji) it make sense to enable -api QuickTimeUTC=1 because both store the time relative to UTC zero.

-Jens
macOS Sierra

Phil Harvey

Hi Jens,

Ah.  Glad you figured this out.  I wasn't thinking about a problem in your time converter.  That certainly would cause this confusion.

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