Hide the time in datestamp

Re: Hide the time in datestamp

by Purnendu Dash -
Number of replies: 0
Picture of Plugin developers

You can try the below given code for removing time and show only date in format of "Monday, 23 January 2017" instead of "Monday, 23 January 2017, 11:21 AM"

$by->date = date('l, d F Y',$entry->created );

Add the code in <your moodle>/theme/<your preferable theme>/renderers.php [which is recommended]

require_once($CFG->dirroot .'/blog/renderer.php');
class theme_<your preferable theme>_core_blog_renderer extends core_blog_renderer {
 /*overwrite render_blog_entry function here*/
public function render_blog_entry(blog_entry $entry) {

    .....
   /*use this code instead of $by->date = userdate($entry->created );
    $by->date = date('l, d F Y',$entry->created );
}

}

or, you can directly change the code in <your moodle>/blog/renderer.php in function render_blog_entry.


Regards,

Purnendu