home *** CD-ROM | disk | FTP | other *** search
/ Magazyn WWW 1999 July / www_07_1999.iso / prez / amiga / KidHTML1_25.lha / KidHTML1.25 / Script / timestamp.js < prev   
Text File  |  1998-08-25  |  933b  |  44 lines

  1. <!-- ONE STEP TO INSTALL DATE & TIME STAMP:
  2.  
  3.    1.  Paste the coding into the BODY of your HTML document  -->
  4.  
  5. <!-- STEP ONE: Copy this code into the BODY of your HTML document  -->
  6.  
  7. <BODY>
  8.  
  9. <CENTER>
  10. <SCRIPT LANGUAGE="JavaScript">
  11.  
  12. <!-- This script and many more are available online from -->
  13. <!-- The JavaScript Source!! http://javascriptsource.com -->
  14.  
  15. <!-- Begin
  16. Stamp = new Date();
  17. document.write('<font size="2" face="Arial"><B>' + (Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+Stamp.getYear() + '</B></font><BR>');
  18. var Hours;
  19. var Mins;
  20. var Time;
  21. Hours = Stamp.getHours();
  22. if (Hours >= 12) {
  23. Time = " P.M.";
  24. }
  25. else {
  26. Time = " A.M.";
  27. }
  28. if (Hours > 12) {
  29. Hours -= 12;
  30. }
  31. if (Hours == 0) {
  32. Hours = 12;
  33. }
  34. Mins = Stamp.getMinutes();
  35. if (Mins < 10) {
  36. Mins = "0" + Mins;
  37. document.write('<font size="2" face="Arial"><B>' + Hours + ":" + Mins + Time + '</B></font>');
  38. // End -->
  39. </SCRIPT>
  40. </CENTER>
  41.  
  42. <!-- Script Size:  0.97 KB  -->
  43.