video creation date in local datetime

Started by paolobenve, September 27, 2022, 11:00:29 AM

Previous topic - Next topic

paolobenve

I have various videos, made with different cameras.

What tag should I read in order to get to local datetime of the creation of the video?

I'm seeing a mess, with some tag with UTC datetime....

StarGeek

Quote from: paolobenve on September 27, 2022, 11:00:29 AMI have various videos, made with different cameras.

It depends upon the camera and if it was aware of time zones or not.

The cameras on most modern phones seem to set the time stamps correctly, but not always.  I'm not sure about more recent DSLRs, but older ones probably set videos to local time.

You're probably going to have to check on each file individually.  You can use this command to see all the time related metadata in the file.
exiftool -time:all -G1 -a -s /path/to/files/

See this post for which tags should be local/UTC.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

paolobenve

#2
@StarGeek, thank you for your answer!

If I understood correctly, you said that different video could have local or utc creation time in the same tag.

Would it be possible to perform some check in order to be sure that the local video creation time be extracted?

For example:

dateTimeCreation + OffsetTimeOriginal
else QuickTime:CreateDate
else CreateDate

Phil Harvey

In general this is not possible.  But some videos contain additional date/time tags which can clear things up.  And sometimes looking at the filesystem date/time information (like FileModifyDate) can help too.

Use the command StarGeek gave to see what is best for your files.

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

paolobenve

> Use the command StarGeek gave to see what is best for your files.

I'm developing an app, I want to come to an algorithm for reading the creation date of any video

Phil Harvey

OK then:  Simply not possible to do what you want.

Adobe, Microsoft, Apple and Google can't do this correctly either.  (Witness the number of threads in this forum from people having time zone problems with these softwares.)

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