Ok, I modify the printImageMetadata function:
.../...
echo "\n";
foreach ($exif as $field => $value) {
$display = $_zp_exifvars[$field][3];
if ($display) {
$label = $_zp_exifvars[$field][2];
echo "$label:";
if ($field == "EXIFModel") $apn = $value;
if ($field == "EXIFDateTimeOriginal") $value = exif_date($value, $apn);
printEditable('image', $field, $editable, $editclass, $messageIfEmpty, false, $value);
echo "\n";
}
}
echo "\n\n";
.../...
function exif_date($date,$apn) {
//'Model' => string 'Canon EOS 50D' (length=13)
//50D: 'DateTimeOriginal' => string '2009:12:05 12:42:33' (length=19)
//'Model' => string 'Canon EOS 7D' (length=12)
//7D: DateTimeOriginal' => string '2010-02-20T15:07:05.24+01:00' (length=28)
// -> 50D
if (!preg_match("/7D/", $apn)) {
$pieces = explode(' ', $date);
list($yy, $mm, $dd) = explode(':', $pieces[0]);
list($hh, $min, $ss) = explode(':', $pieces[1]);
}
// 7D
else {
$pieces = explode('T', $date);
list($yy, $mm, $dd) = explode('-', $pieces[0]);
$pieces_h = explode('.', $pieces[1]);
list($hh, $min, $ss) = explode(':', $pieces_h[0]);
}
$timestamp = mktime((int) $hh, (int) $min, (int) $ss, (int) $mm, (int) $dd, (int) $yy, '-1');
$date = date('d.m.Y Ã H:i',$timestamp);
return $date;
}
I would suggest that instead of checking for the camera model, check for the time format itself. I suspect that other cameras use the ISO-8601 time format as well, and it would be a pain to keep updating the script for each camera model, rather than using a RegEx or similar to identify the time format, and display it accordingly. That would be more effective, and less maintenance.
I know PHP's strftime function can format a date/time in ISO-8601 format, but am not sure if strtotime or a similar built-in function can parse it.
Just my thoughts, as a programmer (though not specifically for PHP)! :-)