The table is OK the difficulty I'm having is I'm supposed to show how many days left are to my exam.
I already have the date today but how would you solve it for days ago or even hours ago?
var now = new Date ();
document.write("<br>Now:" + now);
Posted 04 October 2012 - 03:51 PM
var now = new Date ();
document.write("<br>Now:" + now);
Posted 04 October 2012 - 04:31 PM
// Get the Unix timestamp representing the current time. var current_timestamp = Date.now(); // Calculate how many milliseconds there are in two days. var two_days = (1000 * 60 * 60 * 24 * 2); // Calculate the timestamp two days ago. var two_days_ago = current_timestamp - two_days; // Show the formatted date in some element. target.innerHTML = new Date(two_days_ago);
|
|
Query failed: connection to localhost:3312 failed (errno=111, msg=Connection refused).
|
