title: How to detect app launched first time in a day
body: <p>I have app, whenever it launched first time in day then I should execute some logic. I have checked in google but I didnt get any good working logic,
  If anybody knows this, pls suggest me.</p>
  
  <p>till now I have tried with this code</p>
  
  <pre><code>       var firstTime = new Date().getTime();
         if(window.localStorage.getItem('firstTime') == null){
              window.localStorage.setItem('firstTime', firstTime);
          }else{
              var secondTime = new Date().getTime();
              var storedTime = window.localStorage.getItem('firstTime');
              if(secondTime &gt; storedTime){
                  alert("Second time");
              }else{
                  alert("First time");
              }
          }
  </code></pre>