So, i'm having a lot of trouble with this little piece of code. An example timestamp is this: '1278509422000'.. the problem is that it comes in as a string and I have to convert it somehow. I know about the problem with milliseconds and have tried dividing by a 1000 and much more (intval/floatval) but it just will not become a correct datetime value.
Zend_Loader::loadClass('Zend_Gdata_Photos');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
$gp = new Zend_Gdata_Photos(Zend_Gdata_AuthSub::getHttpClient($data->token), "Bla");
try {
$userFeed = $gp->getUserFeed("default");
foreach ($userFeed as $userEntry) {
$album = $userEntry->getGphotoName();
try {
$query = $gp->newAlbumQuery();
$query->setUser("default");
$query->setAlbumName($album);
$albumFeed = $gp->getAlbumFeed($query);
foreach ($albumFeed as $photo) {
$time = date('Y-m-d H:m:s', $photo->getGphotoTimestamp());
}
} catch(Exception $e) {
}
}
} catch(Exception $e) {
}