Time Sensitive Greeting
- Home
- ASP
- Time Sensitive Greeting
Good Morning, Good Afternoon, Good Evening
Here is a simple function that will return a string on your page displaying an appropriate greeting.
Good Evening, the current time is 8:35:11 PM
This is SERVER time NOT necessarily client time.
<%
Function Greeting()
If Hour(Now) < 12 Then
Greeting = "Good Morning"
ElseIf Hour(Now) < 18 Then
Greeting = "Good Afternoon"
Else
Greeting = "Good Evening"
End If
End Function
%>
<HTML>
<HEAD>
<TITLE>Good Morning, Good Afternoon, Good Evening</TITLE>
</HEAD>
<BODY>
Good Morning, Good Afternoon, Good Evening<br>
Here is a simple function that will return a string on your page displaying an appropriate greeting. <br>
<font face="Arial" Size="2" Color=#993300><%= Greeting() %>, the current time is <%= Time() %> </font>
</BODY>
</HTML>
time asp greeting