Jump to content

[SOLVED] PHP Date help


sando

Recommended Posts

Hi All,

 

Im having a bit of trouble with a blog im working on.

 

It currently outputs the date of posting as:

 

2007-09-01 (Year, Month, Day)

 

I need it to output the date as

 

01-09-2007 (Day, Month, Year)

 

<?include("header.php");

$sql1="select * from blog";

$result1=db_query($sql1);

$num=mysql_num_rows($result1);

$reccnt= mysql_num_rows($result1);

if($order_by=='')

{

$order_by='announcement_date';

$order_by2='desc';

}

?>

 

 

 

<TABLE cellspacing='2' cellpadding='0' border='0'>

 

<?while($row=mysql_fetch_array($rs)){?>

<TR>

<td class='normaltextbold'>

<?=$row[announcement];?> </td>

</TR>

<TR>

<td class='normaltextbold'>

<?=$row[announcement_date];?></td>

</TR>

<tr bgcolor='#FFCFEE'>

<td colspan='2'><img src='images/spacer.gif' height='1' colspan='2'></td>

</tr>

<tr >

<td ><img src='images/spacer.gif' height='5'></td>

</tr>

<?}?>

<tr bgcolor='#FFFFFF'><td colspan='4'><?include("admin/paging.inc.php");?></td></tr>

</TABLE>

 

 

A bit of help would be greatly appreciated! I'm new to working with PHP, and the blog was originally developed by a different person.

 

Cheers!

Link to comment
https://forums.phpfreaks.com/topic/69021-solved-php-date-help/
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.