date/time question
Posted: Tue Jun 10, 2008 8:41 pm
I am a newbie at php but having a good time learning to use it to access my database.
I have a table with a field filled by now() an example would be:
20080610133822
I wrote a php script that gets the last 5 rows from the database and displays it on the webpage. an example would be like this:
TravelBug Name: Sue
Location: Asura
Difficulty: Easy
When posted: 20080610133822
Does anyone have a code snippet that would take this field and compare it to current time and post something like this:
TravelBug Name: Sue
Location: Asura
Difficulty: Easy
When posted: less than a minute ago
OR
....
When posted: 1 hour 4 min ago
Thanks for your help
I have a table with a field filled by now() an example would be:
20080610133822
I wrote a php script that gets the last 5 rows from the database and displays it on the webpage. an example would be like this:
TravelBug Name: Sue
Location: Asura
Difficulty: Easy
When posted: 20080610133822
Does anyone have a code snippet that would take this field and compare it to current time and post something like this:
TravelBug Name: Sue
Location: Asura
Difficulty: Easy
When posted: less than a minute ago
OR
....
When posted: 1 hour 4 min ago
Thanks for your help