Shamsh Sameed Ahsan Shamsh Sameed Ahsan - 1 year ago 72
SQL Question

Display Only Month From Mysql Database

This code displays date as: 13-07-2016
I want to display only month and year. Example: "July 2016"
How do I modify this code so that it gets Only month and year and displays it.


Answer Source
$date = $row['bill_date'];
$month = date('F', strtotime($date));
$year = date('Y', strtotime($date));

<td><?php echo $month . ' ' . $year; ?></td>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download