...

View Full Version : Which format???



radith
07-13-2004, 02:56 AM
<script language="JavaScript"><!--
var startPageLoad = (new Date()).getTime();
function timeSinceStartPageLoad()
{
return ((new Date()).getTime() - startPageLoad) / 1000;
}
document.writeln(timeSinceStartPageLoad())
document.writeln(" seconds")
--></script>

Would the above code return the time in seconds?
Or would it return in another format? I assumed it would be seconds?

Pls. Help. Thanx in advance

Radith Silva
radith@xtra.co.nz

glenngv
07-13-2004, 03:45 AM
Yes. getTime() is in milliseconds so dividing it by 1000 will turn it into seconds.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum