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

  1. <ccResource>
  2.   <ccTitle>
  3. Date
  4.   </ccTitle>
  5.   <ccCategory>
  6. Clocks
  7.   </ccCategory>
  8.   <ccDescription>
  9. This will create a header on the top right side of your webpage with the current date and time.  
  10.   </ccDescription>
  11.   <ccInstructions>
  12. Place this script in between the HEAD tags of your webpage.   Change the size and color of the text by altering the values found in the next to last line of the JavaScript.  
  13.   </ccInstructions>
  14.   <ccHeadContent>
  15.   <SCRIPT LANGUAGE="JavaScript">
  16. //Modified by CoffeeCup Software 
  17. //This code is Copyright (c) 2000 CoffeeCup Software 
  18. //all rights reserved. License is granted to a single user to 
  19. //reuse this code on a personal or business Web Site. 
  20.  
  21.         var now = new Date();
  22.         var hours = now.getHours();
  23.         var minutes = now.getMinutes();
  24.         var timeValue = "" + ((hours >12) ? hours -12 :hours)
  25.         timeValue += ((minutes < 10) ? ":0" : ":") + minutes
  26.         timeValue += (hours >= 12) ? " P.M." : " A.M."
  27.         timerRunning = true;
  28.  
  29.  
  30.      mydate = new Date();
  31.      myday = mydate.getDay();
  32.      mymonth = mydate.getMonth();
  33.      myweekday= mydate.getDate();
  34.      weekday= myweekday;
  35.      myyear= mydate.getYear();
  36.      year = myyear
  37.  
  38.      if(myday == 0)
  39.              day = " Sunday, "      
  40.  
  41.      else if(myday == 1)
  42.            day = " Monday, "
  43.  
  44.      else if(myday == 2)
  45.              day = " Tuesday, "   
  46.  
  47.      else if(myday == 3)
  48.              day = " Wednesday, "   
  49.  
  50.      else if(myday == 4)
  51.              day = " Thursday, "
  52.  
  53.      else if(myday == 5)
  54.              day = " Friday, "
  55.  
  56.      else if(myday == 6)
  57.              day = " Saturday, "
  58.  
  59.      if(mymonth == 0)
  60.               month = "January "
  61.  
  62.      else if(mymonth ==1)
  63.               month = "February "
  64.  
  65.      else if(mymonth ==2)
  66.              month = "March "
  67.  
  68.      else if(mymonth ==3)
  69.             month = "April "
  70.  
  71.      else if(mymonth ==4)
  72.               month = "May "
  73.  
  74.      else if(mymonth ==5)
  75.               month = "June "
  76.  
  77.      else if(mymonth ==6)
  78.               month = "July "
  79.  
  80.      else if(mymonth ==7)
  81.             month = "August "
  82.  
  83.      else if(mymonth ==8)
  84.            month = "September "
  85.  
  86.      else if(mymonth ==9)
  87.           month = "October "
  88.  
  89.      else if(mymonth ==10)
  90.           month = "November "
  91.  
  92.      else if(mymonth ==11)
  93.           month = "December "
  94.  
  95.      document.write("<B><P ALIGN=RIGHT><FONT SIZE=-1 FACE=VERDANA,ARIAL>" + timeValue + " | " +day + month);
  96.      document.write(myweekday+","+ " 2000</FONT></B><BR><HR WIDTH=300 ALIGN=RIGHT><P>");
  97.  
  98. </SCRIPT>
  99. <!--This is the end of the JavaScript Make sure this script is between the HEAD tags-->
  100.   </ccHeadContent>
  101.   <ccBodyContent>
  102.  
  103.   </ccBodyContent>
  104.   <ccElementContent>
  105.   
  106.    <ccElementName></ccElementName>
  107.    <ccElementAction></ccElementAction>
  108.    
  109.   </ccElementContent>
  110.   <ccExtraData>
  111.  
  112.   </ccExtraData>
  113. </ccResource>