6
$\begingroup$

I am trying to rename few images by their date and time taken.

Is there a way to get the date and time when photo was taken using Mathematica?

$\endgroup$
10
$\begingroup$

WL supports access to image EXIF, IPTC and XMP data. e.g. to get the date/time from EXIF:

Import["ExampleData/coneflower.jpg", "Exif"]["DateTime"] // DateString
(* Tue 19 Aug 2008 11:29:05 *)

Check the Scope and Import Elements sections of the documentation for details.

$\endgroup$
  • 8
    $\begingroup$ You can also get it directly: Import["ExampleData/coneflower.jpg", "DateTime"] $\endgroup$ – C. E. Aug 16 at 4:20
  • $\begingroup$ @C.E. Do you know if that is the EXIF or IPTC or XMP date/time? I looked at the documentation and did not find an answer. $\endgroup$ – Rohit Namjoshi Aug 17 at 1:10
  • $\begingroup$ It is Exif. If you look at the documentation for JPEG, Import Elements -> Available Elements -> Metadata -> Exif, you will find an example like the one I posted with the text "Individual Exif tags can also be imported directly". $\endgroup$ – C. E. Aug 17 at 5:28
  • $\begingroup$ Thanks for the solution which works great. Do you know if we can get Date and time for .Mp4 and .Mov? I tried the method but it didn’t work $\endgroup$ – Algohi Aug 18 at 22:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.