get 24 hours time from current in javascript code example
Example 1: javascript get 24 hour time
var date = new Date();
console.log(date.toLocaleString('en-GB'));
Example 2: javascript calculate 24 hours ago
var ts = Math.round(new Date().getTime() / 1000);
var tsYesterday = ts - (24 * 3600);