I would like to add the last modified date to the index page , the below code shows the 31/12/1969 is the last modified date.
echo date("d/m/Y",filemtime("index.php"));
I would like to add the last modified date to the index page , the below code shows the 31/12/1969 is the last modified date.
echo date("d/m/Y",filemtime("index.php"));
My guess is
filemtime
is not finding your file.filemtime
will return 0, or something that equates to 0 like FALSE, and then applyingdate
on time0
will return 0 seconds since the epoch (1st Jan 1970).Looks like that's what you're getting. I'm also guessing you're using PHP <= 5.1.
I guess the path is wrong. At last on your development system you should increase the error settings.
In case of an erro
filemtime()
returnsfalse
, what what gets casted into0
by thedate()
-call.You should refer your files on the filesystem using (pseudo-)absolute paths.