date/time page was last edited
Permalink
I thought I had this snippet of code working to return the date / time the page was last edited, but it is returning the date and time the last time any page was edited. How do I make this return the date of a specific page.?
[code]
<?php
Loader::model('page_statistics');
echo date('F j, Y', strtotime(pageStatistics::getSiteLastEdit()));
?>
thanks
[code]
<?php
Loader::model('page_statistics');
echo date('F j, Y', strtotime(pageStatistics::getSiteLastEdit()));
?>
thanks
That's the public date not the modified date. I think you need to grab it from the database, none of the examples in the forums seem to work correctly, Maybe something like this:
That doesn't work either.. this does:
// Load Date Helper $date = Loader::helper("date"); // You may need to define $c global $c; // Get Blocks in Main area foreach($c->getBlocks('Main') as $b) { $bDate[$i] = $b->getBlockDateLastModified(); $i ++; } // Reverse Sort Date Array rsort( $bDate ); //Echo Date and Time Page last Edited echo $date->getLocalDateTime($bDate[0],$mask = 'm-d-Y g:i:s');
this link may help:http://www.concrete5.org/documentation/developers/pages/overview...