CMS MADE SIMPLE FORGE

Server Clock

 

[#3957] wrong time

avatar
Created By: (Zet)
Date Submitted: Fri Aug 28 09:20:03 -0400 2009

Assigned To: Georg Busch (nan)
Version: v1.0
CMSMS Version: None
Severity: Critical
Resolution: Awaiting Response
State: Open
Summary:
wrong time
Detailed Description:
I'm runnig CMS 1.6.3. and browser is safari 4. 
the bug:
If first second ist displayed, then next second is displayed as 11. This take
the time on page in future, that means, when page is refreshed, it jumps back on
real time. I fixed the bug with some changes in Javascript.

Function in version 1.0:

function createTime() 
{
	var currentHours = currentTime.getHours();
	var currentMinutes = currentTime.getMinutes();
	var currentSeconds = currentTime.getSeconds();

	if (currentHours < 10)
	currentHours = "0" + currentHours;
	if (currentMinutes < 10)
	currentMinutes = "0" + currentMinutes;
	if (currentSeconds < 10)
	currentSeconds = "0" + currentSeconds;
	currentTime.setSeconds( currentSeconds+1 );
document.getElementById("time").innerHTML = currentHours + ":" + currentMinutes
+ ":" + currentSeconds;
	window.setTimeout("createTime()", 1000);
}

Repaired:

function createTime() 
{
	var currentHours = currentTime.getHours();
	var currentMinutes = currentTime.getMinutes();
	var currentSeconds = currentTime.getSeconds();
	var prefixHours = "";
	var prefixMinutes = "";
	var prefixSeconds = "";

	if (currentHours < 10)
	prefixHours = "0";
	if (currentMinutes < 10)
	prefixMinutes = "0";
	if (currentSeconds < 10)
	prefixSeconds = "0";
	currentTime.setSeconds( currentSeconds+1 );
document.getElementById("time").innerHTML = prefixHours + currentHours + ":" +
prefixMinutes + currentMinutes + ":" + prefixSeconds + currentSeconds;
	window.setTimeout("createTime()", 1000);
}


History

Comments
avatar
Date: 2010-03-26 16:51
Posted By: Georg Busch (nan)

Sorry for the late reply.
Did not recieve a message for this bug.
I will update it recently.

Thanks for the solution.
      
Updates

Updated: 2010-03-26 19:49
resolution_id: 5 => 10

Updated: 2010-03-26 16:51
resolution_id: => 5
assigned_to_id: 100 => 3991