I have a MySql datetime value like “2012-04-17 20:48:29”. I want to convert this to a simple text like “10 days ago”. I want to do this in either php or javascript! I tried to create my own algorithm to do this. But is there an already available solution for doing this?
Share
you could use this pattern
you should of course add some conditions before echoing the result. to only show 1 minute ago, or 3 hours ago, or 10 days ago…