title: fetch current time by using aem-sightly
body: <p>I'm new to aem. I'm trying to implement the following example in aem by using sightly. currently im working on aem 6.1. </p>
  
  <p>can you please guide me how can i access current time in sightly. 
  I'm using dialog boxes to show greeting messages according to current time. </p>
  
  <pre><code>&lt;div data-sly-use.clientlibInclude="${'/libs/granite/sightly/templates/clientlib.html'}"&gt;&lt;/div&gt;
  &lt;output data-sly-call="${clientlibInclude.css @ categories='angular-global-category'}" data-sly-unwrap /&gt;
  &lt;html&gt; `enter code here`
  &lt;head&gt;
      &lt;title&gt;Greeting Message using JavaScript&lt;/title&gt; 
  &lt;/head&gt;
  
  &lt;body&gt;  
  &lt;section class="intro"&gt;
   &lt;h1&gt; &lt;label id="lblGreetings"&gt;&lt;/label&gt;&lt;/h1&gt;&lt;/section&gt;
  &lt;/body&gt;
  &lt;script&gt;
  
      var myDate = new Date();
      var hrs = myDate.getHours();
  
      var greet;
  
      if (hrs &lt; 12)
          greet = 'Good Morning';
      else if (hrs &gt;= 12 &amp;&amp; hrs &lt;= 17)
          greet = 'Good Afternoon';
      else if (hrs &gt;= 17 &amp;&amp; hrs &lt;= 24)
          greet = 'Good Evening';
  
  
      document.getElementById('lblGreetings').innerHTML =
          '' + greet + ' Julio';
  
  &lt;/script&gt; 
  &lt;/html&gt;
  </code></pre>