JSFiddle - React, Tailwind, and code Playground

by Kevin Pliester

HTML

<span>Es ist Tag</span>

JavaScript

(function($) {

	$(function() {
    const hours = new Date().getHours();
    const isDayTime = hours > 6 && hours < 20;
    
    console.log(hours, isDayTime);
    
    if (!isDayTime) {
    	$("span").text("Es ist Nacht");    
    } else {
    	$("span").text("Es ist Tag");
    }
  });

})(jQuery);