home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 9 / IOPROG_9.ISO / contrib / iis4 / iis4_07.cab / Conditional_JScript.asp < prev    next >
Encoding:
Text File  |  1997-09-03  |  758 b   |  46 lines

  1. <%@ LANGUAGE = JScript %>
  2.  
  3. <HTML>
  4.     <HEAD>
  5.         <TITLE>Conditional Operator Sample</TITLE>
  6.     </HEAD>
  7.  
  8.     <BODY BGCOLOR="White" topmargin="10" leftmargin="10">
  9.  
  10.  
  11.         <!-- Display Header -->
  12.  
  13.         <font size="4" face="Arial, Helvetica">
  14.         <b>Conditional Operator Sample</b></font><br>
  15.       
  16.         <hr size="1" color="#000000">
  17.  
  18.  
  19.         <%
  20.             // Determine Date
  21.  
  22.             var dtmVar = new Date();
  23.         %>
  24.         
  25.         
  26.         <!-- Display Date -->
  27.  
  28.         <P>The date is: <%=dtmVar%></p>  
  29.  
  30.  
  31.         <%
  32.             // Check for AM/PM, and output appropriate message
  33.         
  34.             if (dtmVar.getHours() > 17)
  35.             {
  36.                 Response.Write("<P>Good Evening</p>");
  37.             }
  38.             else
  39.             {
  40.                 Response.Write("<P>Good Morning</p>");
  41.             }
  42.         %>
  43.  
  44.     </BODY>
  45. </HTML>
  46.