PDA

View Full Version : DD Forum Style Date and Time Script



DawnoftheVincent
02-19-2009, 05:25 AM
I'm looking for a script that will display the date and time of posted items on my website in the same way the Dynamic Drive forum does.

Eg: when a thread is first posted, the date will read something like "Today 04:14pm", then tomorrow it will read "Yesterday 04:14pm", then the day after that it will revert to a standard date, like "18-2-2009 04:14pm".

I'm using .php pages, and none of my posted items are stored in a database, if that helps.

Been Googling for hours without luck, so any assistance would be appreciated.

Medyman
02-19-2009, 08:07 PM
If not in a database, where are your posted items stored? Are you manually adding pages?

If you can access the date, you can use PHP's time related functions to do all the calculations. Here (http://www.sajithmr.com/php-time-ago-calculation/) is one way to go about it. Here (http://us3.php.net/manual/en/function.time.php#78677) is another. I'm sure there are others.

DawnoftheVincent
02-19-2009, 09:13 PM
If not in a database, where are your posted items stored? Are you manually adding pages?

Yes, I upload pages to the server. Static HTML pages essentially.

I should add that I am a PHP retard and know virtually nothing about it.