This is a discussion on How do I show a customized message based on the time of day? within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi all... How do I show a customized message based on the time of day? Thanks......
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi, Use following script, <script language="JavaScript"><!-- var date = new Date(); var hours = date.getHours(); if ( (hours < 6) || (hours >= 22) ) document.write("Good Night") else if ( (hours >= 19) && (hours < 22) ) document.write("Good Evening") else if ( (hours >= 6) && (hours < 9) ) document.write("Good Morning") else document.write("Good Day"); //--></script> Thanks Sathian.K |
| |||
| Hi all... <script language="JavaScript"> var date = new Date(); var hours = date.getHours(); if ( (hours > 11) document.write("Good Afternoon") else if ( (hours > 17) document.write("Good Evening") else document.write("does not have"); </script> Thanks... |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| show clocks, one showing the current time, and another showing a time 12 hours behind | itbarota | HTML, CSS and Javascript Coding Techniques | 1 | 02-13-2008 10:15 PM |
| Product-based Company and Projects-based Company : | vigneshgets | Software Testing | 0 | 01-15-2008 11:03 PM |
| Why do I get Error message "Unable to Start Debugging" Error Message? | a.deeban | ASP and ASP.NET Programming | 5 | 09-25-2007 12:22 AM |
| How can I set the time zone for MySQL to UK time? | itbarota | PHP Programming | 1 | 09-12-2007 01:13 AM |
| Diff between Transaction-time and Server response-time | vadivelanvaidyanathan | Software Testing | 0 | 03-21-2007 07:29 AM |