Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.