title: How to echo greetings based on users local time?
body: <p>I want to Echo greetings like Hi (username), (message)! on homepage based on users local time. I know this code is to be used. but don't know how..</p>
  
  <pre><code>&lt;script&gt;
  var now = new Date();
  var hrs = now.getHours(); //getHours takes visitors local time, not server time.
  
  var msg = "";
  
  if (hrs &gt;  0) msg = "Mornin' Sunshine!"; // REALLY early
  if (hrs &gt;  6) msg = "Good morning";      // After 6am
  if (hrs &gt; 12) msg = "Good afternoon";    // After 12pm
  if (hrs &gt; 17) msg = "Good evening";      // After 5pm
  if (hrs &gt; 22) msg = "Go to bed!";        // After 10pm
  
  
  &lt;/script&gt;
  </code></pre>