0

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.

2
  • echo date('"d F Y"', strtotime($row_rsLatest['date'])); Commented Sep 28, 2016 at 9:57
  • try my answers @steve joiner Commented Sep 28, 2016 at 10:13

4 Answers 4

1

Try this will may help you,

<span class="date"><?php echo date('d M Y',strtotime($row_rsLatest['date'])); ?></span> 
Sign up to request clarification or add additional context in comments.

1 Comment

Glad to help you.
1

You can use like that.

echo date('d F Y',strtotime($yourDate)); 

Comments

0

You can use strtotime() and date():

$date = date("d-F-Y", strtotime($row_rsLatest['date'])); 

1 Comment

if you don't mind M - A short textual representation of a month (three letters)
0

Try this Date() format

<?php echo date('d F Y', strtotime(date('2016-09-28'))); ?> 

OUTPUT:

28 September 2016 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.