Javascript Count Up
Javascript Count Up
Out of context: Reply #10
- Started
- Last post
- 11 Responses
- monNom0
if you want to rebase your client's clock to the server clock, pass the server time into a javascript variable, subtract from the time returned by a new Date() object, then add (subtract?) that to the time each time you create a new date object..
ie:
var serverTime = 123456;
var clientTime = new Date();
var rebase = clientTime-serverTime;
var WhatTimeIsItReally = new Date() + rebase;