TeddyKiller Posted April 7, 2010 Share Posted April 7, 2010 This will include timestamp in which is in the database, and current time. I want to be able to display a timestamp, not in a date format. eg: y,m,d etc. But in a .. "x days ago" method. If the timestamp in the database is.. within 24 hours from current time, it'll display "posted X hours ago" If the timestamp is within 1 hour, it'll display "Posted X minutes ago" Else if the timestamp is bigger than 24 hours, it'll display "Posted x days ago" How can this be done? Link to comment https://forums.phpfreaks.com/topic/197931-posted-2-days-ago-how-would-i-do-something-similar/ Share on other sites More sharing options...
premiso Posted April 7, 2010 Share Posted April 7, 2010 http://snippets.dzone.com/posts/show/3044 A "Time Since" function is what you are after. Link to comment https://forums.phpfreaks.com/topic/197931-posted-2-days-ago-how-would-i-do-something-similar/#findComment-1038631 Share on other sites More sharing options...
TeddyKiller Posted April 7, 2010 Author Share Posted April 7, 2010 Perfect! Thanks premiso. Link to comment https://forums.phpfreaks.com/topic/197931-posted-2-days-ago-how-would-i-do-something-similar/#findComment-1038640 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.