Wow, iPhoto’09 is even worse. Photo times are stored as decimal days since Jan 1, 2000 UTC. So, here’s what I used to get a human-readable time out of my little test database:
sqlite> select photoDate, datetime((photoDate + julianday(‘2000-01-01′) – 2440587.5)*86400.0,’unixepoch’,’localtime’) from SqPhotoInfo;
It actually only took me a few minutes to reverse engineer because I’ve noticed that whenever Apple stores a date as a float, it’s almost always Julian days or something related. And I’m used to working with Julian days from my years as an astronomer.
So days prior to Jan 1, 2000, are stored as negative numbers? (Or was someone assuming that no one would want to include scanned photos from past decades and assign them their actual dates?)
Peter Erwin Yes, negative. That’s what clued me into the 2000 epoch, because I’ve been gradually scanning my old photos from the 70s and 80s and adding them to iPhoto.
Comments are closed.