generate timestamp with date in javascript code example
Example 1: javascript current date time
var today = new Date().toLocaleDateString(undefined, {
day: '2-digit',
month: '2-digit',
year: 'numeric',
hour: '2-digit',
minute: '2-digit',
second: '2-digit'
})
Example 2: angular get current timestamp
var currentTimeInSeconds=Math.floor(Date.now()/1000); //unix timestamp in seconds
var currentTimeInMilliseconds=Date.now(); // unix timestamp in milliseconds