home *** CD-ROM | disk | FTP | other *** search
/ PC User 2005 May / CD / PCU0505CD.iso / software / full / coffecup / files / html2005.exe / %MAINDIR% / Javascript / DisplayTime.xml < prev    next >
Encoding:
Text File  |  2005-02-16  |  1.2 KB  |  64 lines

  1. <ccResource>
  2.   <ccTitle>
  3. Display Time
  4.   </ccTitle>
  5.   <ccCategory>
  6. Clocks
  7.   </ccCategory>
  8.   <ccDescription>
  9. Displays the current system time to the visitor of your site.
  10.   </ccDescription>
  11.   <ccInstructions>
  12.  
  13.   </ccInstructions>
  14.   <ccHeadContent>
  15.   <script language="JavaScript">
  16. <!--
  17. var Temp;
  18. setClock();
  19. function setClock() {
  20. CC_Time = "";
  21. now = new Date();
  22. var CurHour = now.getHours();
  23. var CurMinute = now.getMinutes();
  24. now = null;
  25. if( CurHour > 12 ) {
  26. CurHour = CurHour - 12;
  27. ampm = 1;
  28. }
  29. else
  30. ampm = 0;
  31. if( CurHour == 0 )
  32. CurHour = 12;
  33. if( CurMinute < 10 )
  34. CurMinute = "0" + CurMinute;
  35. CurHour = "<FONT SIZE=2><B>" + CurHour + ":" + CurMinute + "</B>";
  36. if( ampm == 1 )
  37. CurHour = CurHour + " P.M.";
  38. else
  39. CurHour = CurHour + " A.M.";
  40. Temp = CurHour;
  41. }
  42. function pathOnly (InString)  {
  43. LastSlash=InString.lastIndexOf ('/', InString.length-1)
  44. OutString=InString.substring  (0, LastSlash+1)
  45. return (OutString);     
  46. }
  47. // -->
  48. </script>
  49.   </ccHeadContent>
  50.   <ccBodyContent>
  51. <script>
  52. document.write( Temp );
  53. </script>
  54.   </ccBodyContent>
  55.   <ccElementContent>
  56.   
  57.    <ccElementName></ccElementName>
  58.    <ccElementAction></ccElementAction>
  59.    
  60.   </ccElementContent>
  61.   <ccExtraData>
  62.  
  63.   </ccExtraData>
  64. </ccResource>