You are here: irt.org | FAQ | JavaScript | Date | Q50 [ previous next ]
<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>