Last modification time of your web page

Discussion in 'Programming' started by linkstraffic, Jun 28, 2006.

  1. #1
    Hi,

    Do you have any web script able to fetch the last modification time of your webpage.
    I would be interested in how Google does.
     
    linkstraffic, Jun 28, 2006 IP
  2. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #2
    hope this will do it

    
    <!-- ONE STEP TO INSTALL LAST MODIFIED:
    
       1.  Paste the coding into the BODY of your HTML document  -->
    
    <!-- STEP ONE: Copy this code into the BODY of your HTML document  -->
    
    <BODY>
    
    <CENTER>
    <SCRIPT LANGUAGE="JavaScript">
    
    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->
    
    <!-- Begin
    var days = new Array(8);
    days[1] = "Sunday";
    days[2] = "Monday";
    days[3] = "Tuesday";
    days[4] = "Wednesday";
    days[5] = "Thursday";
    days[6] = "Friday";
    days[7] = "Saturday";
    var months = new Array(13);
    months[1] = "January";
    months[2] = "February";
    months[3] = "March";
    months[4] = "April";
    months[5] = "May";
    months[6] = "June";
    months[7] = "July";
    months[8] = "August";
    months[9] = "September";
    months[10] = "October";
    months[11] = "November";
    months[12] = "December";
    var dateObj = new Date(document.lastModified)
    var wday = days[dateObj.getDay() + 1]
    var lmonth = months[dateObj.getMonth() + 1]
    var date = dateObj.getDate()
    var fyear = dateObj.getYear()
    if (fyear < 2000) 
    fyear = fyear + 1900
    document.write(wday + ", " + lmonth + " " + date + ", " + fyear)
    // End -->
    </SCRIPT>
    </CENTER>
    
    <p><center>
    <font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
    by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
    </center><p>
    
    <!-- Script Size:  1.17 KB  -->
    
    Code (markup):
    this one does for sure
    
    <script language="JavaScript" type="text/javascript">
    <!--
    var a;
    a=new Date(document.lastModified);
    lm_year=a.getYear();
    if (lm_year<1000){ 				
    if (lm_year<70){
    lm_year=2000+lm_year;
    }
    else lm_year=1900+lm_year;
    
    lm_month=a.getMonth()+1;
    if (lm_month<10){
    lm_month='0'+lm_month;
    }
    lm_day=a.getDate();
    if (lm_day<10){
    lm_day='0'+lm_day;
    }
    document.write("Last updated " + lm_day+'/'+lm_month+'/'+lm_year);
    // -->
    </script>
    
    Code (markup):
     
    ludwig, Jul 2, 2006 IP
  3. linkstraffic

    linkstraffic Well-Known Member

    Messages:
    388
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    133
    #3
    Sorry I should have said:
    ...of a webpage but your script is interesting, I will give it a try.
     
    linkstraffic, Jul 3, 2006 IP