Cambios en Última página para mostrar el día, fecha, mes y hora

  • Quartzman
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Dic 07, 2008
  • Mensajes: 10
  • Status: Offline

Nota Agosto 27th, 2009, 2:36 pm

Acabo de terminar un gran sitio web y el único problema que tengo es con la "Página actualizada por última operación". Tengo un update.js además de los siguientes archivos en cada página: --

Código: [ Select ]
  <script language="JavaScript" type="text/javascript">
     //<!--
     document.write("<center> Last Update: ");
     document.writeln(DocDate(),"<\/center>");
     // -->
    </script>
  1.   <script language="JavaScript" type="text/javascript">
  2.      //<!--
  3.      document.write("<center> Last Update: ");
  4.      document.writeln(DocDate(),"<\/center>");
  5.      // -->
  6.     </script>


Lo anterior me da: -- Última actualización: Domingo 23 de agosto 2009

He utilizado este sistema en mi antiguo sitio web y funcionó bien. Lo anterior sin embargo ahora se actualiza cada día (fecha real) Tal vez el actualizar. JS archivo ha sido dañado de alguna manera (no sé cómo). Lo que me gustaría es algo como lo siguiente: --

Página actualizada por última Jueves 27 Agosto 2009 09:45 pm (esto necesita ser H. Esp)

¿Alguien puede aconsejarme. He pasado algún tiempo mirando a través de este sitio del foro, pero no puede encontrar la respuesta.

El nuevo sitio web ha sido construido usando XHTML thats la différance principal.
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Agosto 27th, 2009, 2:36 pm

  • mindfullsilence
  • Professor
  • Professor
  • Avatar de Usuario
  • Registrado: Ago 04, 2008
  • Mensajes: 846
  • Status: Offline

Nota Agosto 27th, 2009, 2:49 pm

¿Cuál es en su update.js archivo? ¿Podría publicar el código?
Use your words like arrows to shoot toward your goal.
  • Quartzman
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Dic 07, 2008
  • Mensajes: 10
  • Status: Offline

Nota Agosto 27th, 2009, 9:40 pm

Código: [ Select ]
function getLongDateString()
{    //method defined on class Date.
    //Returns a date string of the form: Day DD Month,YYYY
    //(e.g. Sunday 27 September, 1998)
    monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
    dayOfWeek = this.getDay();
    day = dayNames[dayOfWeek];
    dateOfMonth = this.getDate();
monthNo = this.getMonth();
    month = monthNames[monthNo];
year = this.getYear();
    if (year < 2000)
year = year + 1900;
dateStr = day+" "+dateOfMonth+" "+month+", "+year;
    return dateStr;
}
//register the method in the class Date
Date.prototype.getLongDateString=getLongDateString;

function DocDate()
{ //return the document modification date (excl.time)
//as a string
    DateTimeStr = document.lastModified;
    secOffset = Date.parse(DateTimeStr);
    if (secOffset == 0 || secOffset == null) //Opera3.2
             dateStr = "Unknown";
    else
    {
        aDate = new Date();
        aDate.setTime(secOffset);
        //use method defined above
        datestr = aDate.getLongDateString();
    }
    return dateStr;
}
  1. function getLongDateString()
  2. {    //method defined on class Date.
  3.     //Returns a date string of the form: Day DD Month,YYYY
  4.     //(e.g. Sunday 27 September, 1998)
  5.     monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
  6. dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
  7.     dayOfWeek = this.getDay();
  8.     day = dayNames[dayOfWeek];
  9.     dateOfMonth = this.getDate();
  10. monthNo = this.getMonth();
  11.     month = monthNames[monthNo];
  12. year = this.getYear();
  13.     if (year < 2000)
  14. year = year + 1900;
  15. dateStr = day+" "+dateOfMonth+" "+month+", "+year;
  16.     return dateStr;
  17. }
  18. //register the method in the class Date
  19. Date.prototype.getLongDateString=getLongDateString;
  20. function DocDate()
  21. { //return the document modification date (excl.time)
  22. //as a string
  23.     DateTimeStr = document.lastModified;
  24.     secOffset = Date.parse(DateTimeStr);
  25.     if (secOffset == 0 || secOffset == null) //Opera3.2
  26.              dateStr = "Unknown";
  27.     else
  28.     {
  29.         aDate = new Date();
  30.         aDate.setTime(secOffset);
  31.         //use method defined above
  32.         datestr = aDate.getLongDateString();
  33.     }
  34.     return dateStr;
  35. }

Publicar Información

  • Total de mensajes en este tema: 3 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 183 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC