showing complete dates in javascript code example
Example 1: how to use current data in javascript
var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
Example 2: current time in javascript
new Date().toLocaleString();
>> "09/08/2014, 2:35:56 AM"
Example 3: get current time in js
<script>
var today = new Date();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
</script>