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 Morning, the current time is 1:20:53 AM
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


Back To Top
© 1998 - 2024 psacake.com
Version 7.21 | Advertise on this site