View Single Post
Share |
  #1 (permalink)  
Old 08-06-2008, 05:21 AM
macsperte macsperte is offline
Junior Member
 
Join Date: 08-06-08
Location: Cape Town/South Africa
Posts: 3
iTrader: 0 / 0%
"Clever" date formatting

I am looking for a script for a relative date function, something you find on every RSS feed.

The date is static and part of each news item, which contains the news title, the date/time and the news text.

I am looking for a script which transforms this date into a "clever" format. For example todays date is 8-6-2008. If there is a news item with this date I would like that visitors of the news section read it as "Today", if they are visiting the news section today. If someone reads it tomorrow, it should state "Yesterday" and for the rest of the week "Wednesday". Next week it should just appear as normal date. So same as RSS feeds are displaying the date.

Thanks for any help!
 
Reply With Quote