Gallery2: displaying photo date & time

When viewing an album using Gallery2, each photo has a "Date: dd/mm/yy" line underneath.

The EXIF plugin can automatically detect the date & time the photo was taken on, but only the date is displayed by default. I find the time also important, so I wanted it displayed as well, in the "dd/mm/yy, HH:MM" format.

Unfortunately there's no nice GUI for setting this. It can be done, though, by modifying a line in the file /usr/share/gallery2/modules/core/templates/blocks/ItemInfo.tpl:


{capture name=childTimestamp}{g->date timestamp=$item.originationTimestamp}{/capture}


{capture name=childTimestamp}{g->date timestamp=$item.originationTimestamp format="%D, %R"}{/capture}

The date-template format ("%D" "%R" etc) is explained in PHP's strftime() help page.

Leave a Reply

Your email address will not be published. Required fields are marked *