David Pintassilgo Posted February 17, 2006 at 01:38 PM Report Share #14222 Posted February 17, 2006 at 01:38 PM Aproveitando a dica da tofas, aqui fica como meter automaticamente na página a última edição do ficheiro: <SCRIPT LANGUAGE="Javascript"> document.write("Última Actualização a: " + document.lastModified); </SCRIPT> cool stuffs to check. http://blog.zxcoders.com// Link to comment Share on other sites More sharing options...
David Pintassilgo Posted February 17, 2006 at 03:21 PM Author Report Share #14237 Posted February 17, 2006 at 03:21 PM um "upgrade" do Pedantilva <SCRIPT LANGUAGE="JavaScript"> var data_i = new Date (document.lastModified); var data_f = "Última Actualização a: "; data_f += data_i.getDate(); data_f += "-"; data_f += data_i.getMonth() + 1; data_f += "-"; data_f += data_i.getFullYear(); document.write(data_f); <SCRIPT> cool stuffs to check. http://blog.zxcoders.com// Link to comment Share on other sites More sharing options...
David Pintassilgo Posted February 17, 2006 at 03:31 PM Author Report Share #14242 Posted February 17, 2006 at 03:31 PM e outro do SacoPlastico <SCRIPT LANGUAGE="JavaScript"> document.write(document.lastModified[3]); document.write(document.lastModified[4]); document.write(document.lastModified[2]); document.write(document.lastModified[0]); document.write(document.lastModified[1]); document.write(document.lastModified[5]); document.write(document.lastModified[6]); document.write(document.lastModified[7]); </SCRIPT> cool stuffs to check. http://blog.zxcoders.com// Link to comment Share on other sites More sharing options...
saramgsilva Posted February 20, 2006 at 03:48 PM Report Share #14733 Posted February 20, 2006 at 03:48 PM actualização Já encontrei um que acho que deve funcionar: <SCRIPT LANGUAGE="JavaScript"> function lastMod() { var x = new Date (document.lastModified); Modif = new Date(x.toGMTString()); Year = takeYear(Modif); Month = Modif.getMonth(); Day = Modif.getDate(); Mod = (Date.UTC(Year,Month,Day,0,0,0))/86400000; x = new Date(); today = new Date(x.toGMTString()); Year2 = takeYear(today); Month2 = today.getMonth(); Day2 = today.getDate(); now = (Date.UTC(Year2,Month2,Day2,0,0,0))/86400000; daysago = now - Mod; if (daysago < 0) return ''; unit = 'dias'; if (daysago > 730) { daysago = Math.floor(daysago/365); unit = 'anos'; } else if (daysago > 60) { daysago = Math.floor(daysago/30); unit = 'meses'; } else if (daysago > 14) { daysago = Math.floor(daysago/7); unit = 'semanas' } var towrite = 'Última actualização: '; if (daysago == 0) towrite += 'hoje.'; else if (daysago == 1) towrite += 'ontem.'; else towrite += ' à ' + daysago + ' ' + unit + ' ago'; return towrite; } function takeYear(theDate) { x = theDate.getYear(); var y = x % 100; y += (y < 38) ? 2000 : 1900; return y; } document.write(lastMod()); </SCRIPT> retirado de: http://www.quirksmode.org/js/lastmod.html pois o seguinte pareceu que nao fazia o que se queria ( pareceu que escrevia a data do proprio dia...mesmo nao havendo mudanças... ) um "upgrade" do Pedantilva <SCRIPT LANGUAGE="JavaScript"> var data_i = new Date (document.lastModified); var data_f = "Última Actualização a: "; data_f += data_i.getDate(); data_f += "-"; data_f += data_i.getMonth() + 1; data_f += "-"; data_f += data_i.getFullYear(); document.write(data_f); <SCRIPT> www.saramgsilva.com As minhas apps no WP7 Marketplace Youtube : Galinho - Windows Phone 7.5 Link to comment Share on other sites More sharing options...
saramgsilva Posted February 24, 2006 at 03:31 PM Report Share #15194 Posted February 24, 2006 at 03:31 PM a nao ser o 1º script que coloquei... os outros nao fazem akilo k kero mm... 🙂 www.saramgsilva.com As minhas apps no WP7 Marketplace Youtube : Galinho - Windows Phone 7.5 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now