0

I have a date in the format Mon Mar 26 17:48:16 +0000 2012. I need to convert this as 2 days If the date is thur Mar 29 17:48:16 +0000 2012 then need to display 1 hours ago, and so and so. Does anyone know I do this?

Thanks in advance

user1263260
  • 251
  • 3
  • 6
  • 17
  • this seems to be a duplicate for http://stackoverflow.com/questions/676824/how-to-calculate-the-difference-between-two-dates-using-php – Bogdan Emil Mariesan Mar 29 '12 at 08:50
  • How about using date_diff? A good reference is at http://php.net/manual/en/function.date-diff.php – Chetter Hummin Mar 29 '12 at 08:50
  • The function I wrote for [this question](http://stackoverflow.com/questions/9772014/need-to-rewrite-function-for-date-display/9772549#9772549) will serve you well, I feel. – DaveRandom Mar 29 '12 at 08:54
  • You'll need: http://www.php.net/manual/en/function.strtotime.php http://www.php.net/manual/en/datetime.createfromformat.php http://www.php.net/manual/en/datetime.modify.php – worenga Mar 29 '12 at 08:51

0 Answers0