This is the sample code that i am using which was again came as an answer in the stack, but however, it multiplies the date entirely though the time works faster at the given factor 5.
How to start the time from the current system time and run it faster at 5 times speed simultaniously increasing the date and the time.
var virtualOrigin = Date.parse("2012-01-01T00:00:04"),
realOrigin = Date.parse("2012-01-01T00:00:00"),
factor = 5;
function getVirtual(time) {
return new Date( virtualOrigin + (time - realOrigin) * factor );
}
function pad2(num) {
return ("0"+num).substr(-2);
}
function format(time) {
return time.getDate()
+ ":" + pad2(time.getMonth()+1)
+ ":" + pad2(time.getYear())
+ " " + pad2(time.getHours())
+ ":" + pad2(time.getMinutes())
+ ":" + pad2(time.getSeconds());
}
function startTime() {
var now = new Date();
var display = getVirtual(now);
output.innerText = format(display);
setTimeout(startTime, 1000/factor - (now.getMilliseconds() % (1000/factor)));
}
var output = document.getElementById("txt");
startTime();