Little Problem with EXIF Date/Time Little Problem with EXIF Date/Time
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Little Problem with EXIF Date/Time

Started by Ghettomaster, February 04, 2005, 07:33:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ghettomaster

Hello,

i have a little problem with the EXIF Date/Time output. It looks like: "2004:12:15 22:14:28".
How can i change the output format? Is this even possible? I've searched the forums, looked into the documentation and the FAQ's, but i can't find anything about this....

CU
Ghettomaster

Aditya Mooley

Open exifReader.inc.php from include folder and search for

$retArr["FileDateTime"] = date("d-M-Y H:i:s",$imgInfo["FileDateTime"]);


replace d-M-Y H:i:s with the date format of your choice. Remember it should be a valid PHP date format.
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

Ghettomaster

Change the Date/Time Format in this file has no effect to the output, i've tryed this before I asked here.

And yes i have updated the EXIF informations from the File.

Btw. Excuse my bad english.


In german:
Falls jemand hier deutsch spricht, in Englisch kann ich es leider nicht so gut erklären.
Änderungen in der oben genannten Datei haben weder einen Effekt auf das Format in dem die EXIF Informationen in der Datenbank gespeichert werden, noch einen Effekt auf die Ausgabe. Das bedeutet das Datumsformat liegt in oben genannter Form so in der Datenbank und wird unverändert ausgegeben. Nun weiß ich natürlich nicht wie das in Coppermine gelöst ist, ob die Formatierung des Datums beim auslesen aus der Datei erfolgt, oder erst wenn das Datum in der Galerie ausgegeben wird.


CU
Ghettomaster

elrol

change the code of displayimage.php lines 620 - 627 to the following

if (substr($exif['DateTaken'], 11, 2) >12)
{ $hour = substr($exif['DateTaken'], 11, 2) - 12 ;
$ap = "pm" ;}
else { $hour = substr($exif['DateTaken'], 11, 2)  ;
$ap = "am" ; }


        if (isset($exif['DateTaken'])) $info[$lang_picinfo['Date taken']] = substr($exif['DateTaken'], 5, 2) . "." . substr($exif['DateTaken'], 8, 2) . "." . substr($exif['DateTaken'], 0, 4) . " at " . $hour . ":" . substr($exif['DateTaken'], 14, 2) . " " . $ap ; //$exif['DateTaken'];


it worked for me and i hope it works for you also.. i was having the same prob and noone could help me either, so i found a fix myself..

tutone

Great hack!  How do I make the code spell out the month... so that it matches the date added format?

thanks