Jump to content

[SOLVED] Date Format


bravo14

Recommended Posts

Hi all

 

The date format in the mysql database is yyyy-mm-dd and I want to display the date dd-mmm-yyyy

 

I have tried using the following code after having a look at other sites

 

echo ('<tr><td>'.$row[Date].(j-M-Y)'</td><td><b>Yardley</b></td>');

and I am getting the following error

 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/fhlinux147/y/yardleyheroes.co.uk/user/htdocs/fixtures.php on line 59

 

Can anyone give me any pointers

Link to post
Share on other sites

... and the required format is "dd-mmm-yyyy", not "d-mmm-yyyy".

 

So

echo "<tr><td>".date("d-M-Y", strtotime($row['Date']))."</td><td><b>Yardley</b></td>";

 

@br0ken, When was "yyyy-mm-dd" a unix timestamp? No need to assume, read the first post, first sentence

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.