Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

document.lastModified gives wrong result. How to fix?

  • 2 replies
  • 3 have this problem
  • 13 views
  • Last reply by voscon

more options

using javascript's document.write(document.lastModified works when testing on the computer, but gives the current date when coming from the Web, so clients get the wrong (current) date. Is there a solution?

(using Windows7)

using javascript's document.write(document.lastModified works when testing on the computer, but gives the current date when coming from the Web, so clients get the wrong (current) date. Is there a solution? (using Windows7)

All Replies (2)

more options

Example URL of what you are referring to?

Any chance the website is using side-server scripting?
http://en.wikipedia.org/wiki/Server-side_scripting

more options

Dear Edmeister, Yes, the server-side scripting seems to be the problem, but what is the solution? Asking the server did not help. Nor did a call to a *.js file, same result. Here some more detail, copied at about the same time to show the problem:

The code:

document.write("This page was last edited on " + document.lastModified)

file:///C:/Web-page-design/programBits/acknows.html This page was last edited on 06/17/2013 19:03:00

http://voscon.webs.com/acknows.html This page was last edited on 06/22/2013 01:31:01 (= the current date, NOT the updated one 06/17/2013 19:03:00 as above.)

Thanks for your reply and help so far.