This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.

Smartphone icons created by Freepik - Flaticon

JS if Statement

Display "Good day!" if the hour is less than 18:00:

Good Evening!

if (new Date().getHours() < 18) {
  document.getElementById("demo").innerHTML = "Good day!";
}

The "<" symbol means "less than". So in this case < 18 means less than 18:00 hrs or before 6:00 pm.