document.lastModified in PHP

Forums » Opera for Windows/Mac/Linux » Opera for Windows

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

24. November 2003, 12:53:12

mario_hofer

Posts: 2

document.lastModified in PHP

In one of my PHPs I use following code:

[PHP]
<?php

$myfooter = "<font size=\"1\"><script language=\"JavaScript\" type=\"text/javascript\">

</script></font>";
print $myfooter;

?> [/PHP]

To which file does this document.lastModified belong to?
Because as a result in Opera and Netscape I alsways get:
Last Modified January 1, 1970 GMT
16428 Views since 09/24/2003

Test: [url]http://www.econ.jku.at/test3.php[/url]

And the date displayed in NS and OP is defenitely wrong.

whereas in IE I get (which is the current date and time):
Last Modified 11/24/2003 13:50:27
16428 Views since 09/24/2003

Test: [url]http://www.econ.jku.at/test3.php[/url]


Why do NS and OP always return January 1, 1970 GMT?

mh

24. November 2003, 14:09:51

Moderator

larskl

~ moderator ~

Posts: 22356

January 1, 1970 GMT is the date all JavaScripts and similar things start counting from (most of them in milliseconds). And because you can't modify a PHP file like you modify HTML files the script gives a invalid answer (=1.1.1970).
To insert a working last modified date you should use PHP commands

24. November 2003, 15:42:35

non-troppo

Spinning Top

Posts: 4662

Try this:

[php]<?php echo "Last modified: " . date("F d Y H:i:s.", getlastmod()); ?>[/php]

24. November 2003, 15:49:48

mario_hofer

Posts: 2

Thx a lot for your help.


greetz
Mario

Forums » Opera for Windows/Mac/Linux » Opera for Windows