title: Getting current time and date in vue.js
body: <p>I need to get current time and date in the webpage , i am having the javascript code for it . not sure how to Implement in vue.js .I am attaching the code sample here.</p>
  
  <p>html and plain js code:</p>
  
  <pre><code>&lt;html&gt;
      &lt;body&gt;
  
          &lt;h2&gt;JavaScript new Date()&lt;/h2&gt;
          &lt;p id="timestamp"&gt;&lt;/p&gt;
  
          &lt;script&gt;
              var today = new Date();
              var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
              var time = today.getHours() + ":" + today.getMinutes() + ":" + 
              today.getSeconds();
              var dateTime = date+' '+time;
              document.getElementById("timestamp").innerHTML = dateTime;
          &lt;/script&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>i need to implement in vue.js where should i include whether in mounted or computed or method?</p>