Steve Joiner Steve Joiner - 1 year ago 96
MySQL Question

Change date format to a database value

I am displaying a 'date' Database value on a web page. I use Dreamweaver to build web pages which as I'm sure most are aware produces the PHP when binding the database value to the page. SO I have...

<span class="date"><?php echo $row_rsLatest['date']; ?></span>

The 'date' column on the SQL database holds the value in the YYYY-MM-DD format. I would like to change the format to '28 September 2016' using the 'dFY' syntax.
I have tried applying 'date_format' to the above without success.

Can anyone help?

Thanks in advance.

Answer Source

Try this will may help you,

<span class="date"><?php echo date('d M Y',strtotime($row_rsLatest['date'])); ?></span>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download