We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Exif Plugin question - any way to change the format of date_taken ?

Development and Programming

sm9's avatar
sm9
352 posts
16 years ago
sm9's avatar sm9

Hi there,

I’m just playing around with the Exif plugin and it seems to be working fine.

However, I wonder if anyone can tell me of a way to change the formatting of the {date_taken} value?

At the moment, for a sample image, it displays as: 2008:04:12 16:03:59

But can this be changed to just show the date only in the format of dd/mm/yy (instead of yyyy:mm:dd) with no time? So I want 12/04/08 if possible?

Thanks for any advice,

Stephen

       
Jeremy E's avatar
Jeremy E
5 posts
16 years ago
Jeremy E's avatar Jeremy E

I do it like this: (PHP needs to be on for the template (output))

<div class="captureTime">
                    <?
                        $exifString = "{datetimedigitized}";
                        $exifPieces = explode(":", $exifString);
                        $newExifString = $exifPieces[0] . "-" . $exifPieces[1] . "-" . $exifPieces[2] . ":" .
                                $exifPieces[3] . ":" . $exifPieces[4];
                        $exifTimestamp = strtotime($newExifString);
                        echo date('F j, Y', $exifTimestamp);
                    ?>    
                </div>
       
Danny T.'s avatar
Danny T.
426 posts
16 years ago
Danny T.'s avatar Danny T.

An EXIF plugin! AMAZING! EE developers never cease to amaze!

       
sm9's avatar
sm9
352 posts
16 years ago
sm9's avatar sm9
I do it like this: (PHP needs to be on for the template (output))
<div class="captureTime">
                    <?
                        $exifString = "{datetimedigitized}";
                        $exifPieces = explode(":", $exifString);
                        $newExifString = $exifPieces[0] . "-" . $exifPieces[1] . "-" . $exifPieces[2] . ":" .
                                $exifPieces[3] . ":" . $exifPieces[4];
                        $exifTimestamp = strtotime($newExifString);
                        echo date('F j, Y', $exifTimestamp);
                    ?>    
                </div>

Hi Jeremy,

Thanks for this, much appreciated! I’ll give it a try.

Thanks,

Stephen

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.