How to get server time when a specific block gets updated.

Permalink
What I'm trying to do:

I have a list, that when updated, have to display the hour they were updated. I can make the hour manually updatable, but I would like it for it to update automatically based on server time and based on when the list was updated.

Please check this screenshot:http://i.imgur.com/9s1PgdL.png

The time block doesn't have to be editable, so ignore the fact that it's editable in the screenshot.

Thanks.

 
intuitivereason replied on at Permalink Reply
intuitivereason
You can do this with a block template.

The instructions on how to create a block template are here:http://www.concrete5.org/documentation/how-tos/designers/custom-blo...

You'd only need the view.php unless you have some CSS you wanted to carry over too.

Then in your new view template you could grab the date using the block object with something like this:

$b = Block::getByID($controller->bID);
echo $b->getBlockDateLastModified();


You can see all of the methods for the block template here:http://www.concrete5.org/documentation/developers/blocks/working-wi...