
Originally Posted by
WorldNews
I am not using OO Php.
Can you give me the code in Procedural style?
Also please state how to get the date & time from server and then to compared this to date & time field of the MySQL DB?
ThanX,
The code I posted does both of those. Yes, it is OOP use of DateTime(), but you can just throw it into any portion of your code without any issues. If you desperately do not want to use DateTime as an object, you can use
PHP Code:
$result = date_diff(date(), date('2012-07-17 15:30:17'));
echo date_format($result, '%D days %H hours %I minutes ago');
Bookmarks