<%@ LANGUAGE = JScript %> Conditional Operator Sample Conditional Operator Sample

<% // Determine Date var dtmVar = new Date(); %>

The date is: <%=dtmVar.getMonth()+1%>/<%=dtmVar.getDate()%>/<%=dtmVar.getYear()%>

<% // Switch statement to display a message based on the day of the month switch (dtmVar.getDate()) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: Response.Write("

It's the beginning of the month.

"); break; case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20: Response.Write("

It's the middle of the month.

"); break; default: Response.Write("

It's the end of the month.

"); } %>

The time is: <%=dtmVar.getHours()%>:<%=dtmVar.getMinutes()%>:<%=dtmVar.getSeconds()%>

<% // Check for AM/PM, and output appropriate message if (dtmVar.getHours() >= 12) { Response.Write("

Good Evening

"); } else { Response.Write("

Good Morning

"); } %>