Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2006
    Location
    Denver, CO
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    exif_read_data() and FileDateTime

    Hi all,
    I am trying to extract the date/time of when some photos were taken using exif_read_data(). On some of my jpgs that function gives me exactly what I'd expect: "EXIF.DateTimeOriginal: 2009:10:24 15:00:00"

    on others it returns something like this: "FILE.FileDateTime: 1327500388"


    What does that long number mean? I read elsewhere that it is the number of seconds from Jan. 1, 1970. When I did a rough calculation it came up with a date nowhere near the datestamp on the photo. Is there a way to convert that number into something usable?

    Thanks,
    Jeremy

  • #2
    New Coder
    Join Date
    Sep 2011
    Posts
    80
    Thanks
    0
    Thanked 13 Times in 12 Posts
    Yep it's a unix timestamp.

    Look at date():

    http://php.net/manual/en/function.date.php

    That should allow you to convert it to what you need.

    Also to debug - http://www.epochconverter.com/

  • #3
    New Coder
    Join Date
    Mar 2006
    Location
    Denver, CO
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Mark, that's it. And you wouldn't believe how many places I looked on the internet to clear that up for me.

    Using date() I found out that in this case, "FILE.FileDateTime: 1327500388" refers to the date the image was modified, not to the date on the timestamp, which is what I was hoping it would be. I think my project is hopeless--but it's good to know!

    Jeremy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •