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?


1 Answer 1


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.

  • 9
    $\begingroup$ You can also get it directly: Import["ExampleData/coneflower.jpg", "DateTime"] $\endgroup$
    – C. E.
    Commented Aug 16, 2019 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$ Commented Aug 17, 2019 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.
    Commented Aug 17, 2019 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$ Commented Aug 18, 2019 at 22:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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