Jump to content

[SOLVED] formatting the date


dazzclub

Recommended Posts

Hi all,

 

i would like to display my date as day.month.year, ie (my birthday) 29.10.82

 

here is what i have got so far;

 

function InTheNews()
{
global $dbc;
$query = "SELECT id,title, content,date FROM news_headlines ORDER BY id";
$result = mysqli_query ($dbc, $query)or die(mysqli_error() . "<p>With query:<br>$query");
while ($row = mysqli_fetch_array($result))
//need to format the date on this function
$date = $row['date'];
{
//get NewsID 
echo "<div class=\"headline\">
           <a href=\"news_article.php?news_article=$row[id]\">$row[title]</a>
	   <span class=\"date_of_article\">".date("m.d.y","$date")."</p>
	   <p>$row[content]</p>
           </div>
        
";
}
}

 

Any help would be great :)

Link to comment
https://forums.phpfreaks.com/topic/152238-solved-formatting-the-date/
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.