Pixelpost Forum

Pixelpost Forum (http://www.pixelpost.org/forum/index.php)
-   Hacks and Modifications (http://www.pixelpost.org/forum/forumdisplay.php?f=16)
-   -   EXIF_CAPTURE_DATE format (http://www.pixelpost.org/forum/showthread.php?t=6449)

witty 04-13-2007 03:30 PM

EXIF_CAPTURE_DATE format
 
Hi,

Is there a hack or script, or whatever, available for making the format of EXIF_CAPTURE_DATE a bit more "user friendly"?

Right now, the format displays as:

2006:10:05 16:14:28

I'd prefer it to be displayed in the same format as (my) IMAGE_DATETIME

Oct 5, 2006 - 16:14:28

Possible?


-Witty

Dennis 04-13-2007 04:00 PM

yeah pretty much, perhaps I can whip something up provided I have the time.

witty 04-13-2007 04:14 PM

Hi,

Great thanks... much appreciated. It's not like it's deal-breaker or anything, but my blog sort of depends on image capture times moreso than image posting times. So having a format that's easier to read would be cool.


-Witty

Dennis 04-13-2007 04:43 PM

Ok here ya go: I'm assuming your running version 1.6: open functions_exif.php in your includes folder. Use an ASCII editor, preferably one that understands unix style text files.

Go to line 77
PHP Code:

$capture_date $exif_result['DateTimeOriginalSubIFD']; // Date and Time 

Add the following code below that line:

PHP Code:

$capture_date gmdate('M j, Y - H:i'strtotime($capture_date)+(3600*$cfgrow['timezone'])); 

Save, upload and enjoy.

witty 04-13-2007 06:08 PM

Hi,

Will it work in 1.5 (I suppose I could just try it)? I haven't upgraded to 1.6 yet... which I will as soon as I'm done building the site. Thanks!


-Witty

EDIT:

OK, just tried it. It "works", but somehow changes all of the dates to:

Dec 31, 1969 - 23:59

Dennis 04-13-2007 08:47 PM

ok, I'll look at it later.

Dennis 04-15-2007 10:04 AM

Try this:
PHP Code:

$capture_date gmdate('M j, Y - H:i'$capture_date+(3600*$cfgrow['timezone'])); 


dhdesign 04-15-2007 01:04 PM

Thought this was a neat idea, so I just tried the latest code that you posted, and this is the date that I am getting with mine:

Jan 1, 1970 - 00:00

Dennis 04-15-2007 01:50 PM

Go to the function replace_exif_tags ($language_full, $image_exif, $tpl). Place the following line right after the {

PHP Code:

global $cfgrow

Go to line 78
PHP Code:

$capture_date $exif_result['DateTimeOriginalSubIFD']; // Date and Time 

replace with:

PHP Code:

$capture_date date($cfgrow['dateformat'],strtotime($exif_result['DateTimeOriginalSubIFD'])); // Date and Time 

Save, upload and enjoy.

dhdesign 04-15-2007 02:04 PM

Still not working for me - after the above changes, I get:

Dec 31, 1969 - 20:00

Just wondering - my PP install is on a server that is using PHP version 5.1.4. Could that be causing a conflict with your proposed changes?


All times are GMT. The time now is 01:44 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.