Jump to content

sort dates into months and years?


dbradbury

Recommended Posts

i posted about converting dates, and well ive completed that now :)

 

now i have all my dates in order, closest first...

 

so from todays date [2009/12/22]

its:

  • 2009/12/23
  • 2009/12/24

 

and so on... where the month changes aswell...

 

now is it possible to group the dates? so have all december in a paragraph for table cell...?

or even have a line break or two when the month or year changes?

 

and if you understood that, im impressed :) lol

 

thanks for looking! :)

Link to comment
https://forums.phpfreaks.com/topic/186075-sort-dates-into-months-and-years/
Share on other sites

this is the part that actually displays them...

	
$date = date('l jS F Y', strtotime($row['post_subject']));
echo '<tr><td width="auto" valign="top" align="right">'.$date.'</td><td width="20px" valign="top"> - </td><td width="auto" valign="top">'.nl2br($row['post_text']).'</td></tr>';

 

you may already know what it does, but for those who dont, the $date is setting the inputted data to be converted to a certain text/number and such..

 

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.