Customizing a Message for the Time of Day
You can take the technique used in the last example and use it again to customize a message for the user, depending on the time of day. This is often used as a friendly greeting when a user enters a site. Script 13.3 shows how it is done, and Figure 13.3 shows how we were up writing way past our usual bedtime.
Script 13.3. Scripts can be used to check what time of day it is and react appropriately.
Figure 13.3. It was definitely too late at night when we wrote this.
To customize messages for the time of day: