PDA

View Full Version : Different date/time format for comments


codepoit
05-31-2006, 02:40 PM
I've seen this asked before, but after searching for the last 30 minutes, I can't seem to enter the right criteria to find the thread. Anyway, I am using the datetime format of F d, Y for my site and that's exactly what I want. However, I would like to use a different format for the datetime stamp of comments. I have tried editing the functions.php file in this area...

$comment_datetime = date($cfgrow['dateformat'],$comment_datetime);
$image_comments .= "<li>".nl2br($comment_message)."<br />
$comment_name on $comment_datetime</li>";


...but haven't had any success as of yet. On the last line, after the word "on" if I replace $comment_datetime with date('FOO') it gets displayed as exactly what I type in there, instead of translating it. One quick note: I currently don't have access to my actual database tables. Something I am desperately trying to remedy through my host...long story, don't ask!

Any help?

Thanks,
Chris @ The Last Rewind (http://www.thelastrewind.com/)

GeoS
05-31-2006, 05:42 PM
$cfgrow['dateformat'] - put your format instead of this variable.

So:
$comment_datetime = date("your's format",$comment_datetime);
$image_comments .= "<li>".nl2br($comment_message)."<br />
$comment_name on $comment_datetime</li>";

codepoit
05-31-2006, 06:03 PM
ugh...thank you! Silly me...that was the first thing I tried, except I was putting my format inside the brackets for the variable. Obviously, that wasn't working.

I thank you again, GeoS!