extract only month and day from the date
-
Hi, I created a new template but I’ trying to extract only the day and the month from the date. How to do? Thanks for your help
<?php
$lcp_display_output = ”;
$lcp_display_output .= ‘- ‘;
foreach ($this->catlist->get_categories_posts() as $single):
$data = $this->get_date($single);
echo $data;
$mese = date(‘F’, strtotime($data));
$giorno = date(‘d’, strtotime($data));
$anno = date(‘Y’, strtotime($data));
$lcp_display_output .= ‘<li style=”list-style-type: none;”>’;
$lcp_display_output .= ‘<div style=”background-color: #00467c; text-align: center; width: 100px; height: 100px; float: left; margin: 0 1em 0 0; “><span class=”lptw-dropcap-day” style=”color: #ffffff; “>’.$giorno.'</span><span class=”lptw-dropcap-month” style=”color: #ffffff; “>’.$mese.’ ‘.$anno.'</span></div>’;
$lcp_display_output .= ‘<div class=”float:left;”><h3>’.$this->get_post_title($single).'</h3></div><div style=”clear:left;”></div>’;
$lcp_display_output .= ”;
endforeach;
$lcp_display_output .= ‘‘;
$this->lcp_output = $lcp_display_output;
?>
- The topic ‘extract only month and day from the date’ is closed to new replies.