View Full Version : exif_read_data() and FileDateTime

02-24-2012, 04:26 PM
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?


02-24-2012, 05:23 PM
Yep it's a unix timestamp.

Look at date():


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

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

02-24-2012, 05:54 PM
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!