Welcome Guest, Not a member yet? Register   Sign In
relative dates?
#16

[eluser]delay[/eluser]
I was just looking at doing something similar. There is a good function that handles this on the php site. http://us.php.net/time Look for the "timeDiff" function. It will do exactly what you want. You can also easily convert your mysql dates into the timestamp formats it needs by loading the date helpers.
Code:
$this->load->helper('date');
$unixdate = mysql_to_unix($mysqldate);
then call the timeDiff function from the above link.

Code:
$TimeAgo = $this->timeDiff($unixdate,false, 1, minute);


Messages In This Thread
relative dates? - by El Forum - 12-03-2007, 03:30 PM
relative dates? - by El Forum - 12-03-2007, 04:15 PM
relative dates? - by El Forum - 12-03-2007, 04:16 PM
relative dates? - by El Forum - 12-03-2007, 04:29 PM
relative dates? - by El Forum - 12-03-2007, 05:28 PM
relative dates? - by El Forum - 12-03-2007, 06:04 PM
relative dates? - by El Forum - 12-03-2007, 07:00 PM
relative dates? - by El Forum - 12-04-2007, 09:01 PM
relative dates? - by El Forum - 12-04-2007, 09:37 PM
relative dates? - by El Forum - 12-05-2007, 02:50 AM
relative dates? - by El Forum - 12-05-2007, 03:27 AM
relative dates? - by El Forum - 12-05-2007, 03:57 AM
relative dates? - by El Forum - 12-05-2007, 03:58 AM
relative dates? - by El Forum - 12-05-2007, 06:41 AM
relative dates? - by El Forum - 12-05-2007, 10:19 AM
relative dates? - by El Forum - 01-11-2008, 02:52 PM
relative dates? - by El Forum - 01-12-2008, 03:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB