"How Old Is The Internet" Widget
November 23rd, 2008 | Author: ChipThe Internet appeared in 1983. More detailed discussions on this subject are outside the scope of this article. We will learn how to create a JavaScript widget showing how old is the internet.
First of all, we need to write a prototype function of a date. As the JavaScript code is wrapping a bit weird with my theme, here is the finished .js file:
As the function is included in the head (either external or included), all we need to add is:
<script type="text/javascript"> var oPast = new Date(1983, 1, 1, 0, 0); document.write(oPast.toTimeSinceString(6, ', ', ' and ')); </script>
Download a .zip file with a finished HTML example.