W3C home > Mailing lists > Public > www-jigsaw@w3.org > January to February 2000

lastModified Y2K solution

From: Work, Jason <Jason.Work@BCHydro.bc.ca>
Date: Fri, 7 Jan 2000 18:28:52 -0500 (EST)
Message-ID: <F31B8E63892ED311A8DB0000F81A9700DB4E85@edmm61.bchydro.bc.ca>
To: "'www-jigsaw@w3.org'" <www-jigsaw@w3.org>
I have found a solution to my own problem (that I posted earlier today)
Here it is:

<script language="JavaScript">
<!-- 

var lmd = document.lastModified;
d1=Date.parse(lmd);

// this subtracts 8 hours from the current time
// to make it accountable for Pacific Standard Time
// the number for the time is represented in seconds

d2=d1-28800000;

// the following line of code adds 100 to the year
// to make the year 2000

d2+=3155673600000;

  // check if we have a valid date
  // before proceeding
  if(0 != (d2))
  {
    s = "" + new Date(d2);
  }
document.write( 
  "This page was updated on " + s);


// -->
</script>
Received on Friday, 7 January 2000 19:42:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:34 GMT