Este site irá ter funcionalidade limitada enquanto fazemos manutenção para melhorar a sua experiência. Se um artigo não resolve o seu problema e quiser colocar uma questão, temos a nossa comunidade de apoio à espera de o ajudar em @FirefoxSupport no Twitter, /r/firefox no Reddit.

Pesquisar no apoio

Evite burlas no apoio. Nunca iremos solicitar que telefone ou envie uma mensagem de texto para um número de telefone ou que partilhe informações pessoais. Por favor, reporte atividades suspeitas utilizando a opção "Reportar abuso".

Saber mais

document.lastModified gives wrong result. How to fix?

  • 2 respostas
  • 3 têm este problema
  • 13 visualizações
  • Última resposta por 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)

Todas as respostas (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.