Last modified using format_interval I would like to show interval time for nodes were last modified. I am using the following code: 

&lt;?php print "Last Modified" . format_interval($node-&gt;changed, $langcode, "short"); ?&gt;


I am using $langcode as proposed here to display it in Arabic, but it is not working and I am not sure if I am using it the right way because I get this error Notice: Undefined variable: langcode in include()

Whenever I update any content; interval time still set to 0 sec, so what is wrong with the code?
Your code contains two errors:


You are using a variable which has not been initialized
You are passing the wrong arguments to format_interval()


The required arguments are:


$interval
It's not a timestamp, but the number of seconds until now. In your case, you should use time() - $node-&gt;changed.
$granularity
It's the number of units that are shown; if you pass 2 as value for $granularity and the interval is for 1 year, 3 months, and 2 weeks, format_interval() will return "1 year 3 months".
$langcode
It's the language code for the language to use. If you are hard-coding the language to be Arabic, you should use "ar".