Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Show exact date of post? (not freshness)

Okay, I promise in future I’ll be all mature and responsible and test these things first. Sorry for the inconvenience. This works on my forum now; just copy and paste this into a new plugin file. Then put <?php aposttime(); ?> for default time output, or <?php aposttime( 'DATE FORMAT' ); ?> for your own time formatting.

<?php
/*
Plugin Name: Accurate Post Time
Plugin URI:
Description: Outputs an accurate post time in, optionally, your choice of formatting. Use <?php aposttime( 'DATE FORMAT' ); ?> in your template, <a href="http://uk3.php.net/date">date formatted according to PHP standards.</a>
Author: fel64
Version: Phi
Author URI: http://www.loinhead.net/
*/

function aposttime ( $dtformat = "jS F 'y" ) {
global $bb_post;
$aposttime = date( $dtformat, strtotime( $bb_post->post_time ) );
echo $aposttime;
}
?>

Skip to toolbar