var now = new Date();
var timestring = "" + now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds(); Never too old to learn...
Nico
nvb - you need to handle zeros (so you don't get 7:5:2 when it is 7:50:20)....
<SCRIPT LANGUAGE="JavaScript1.2">
var now = new Date();
var timestring = "" + zero(now.getHours()) + ":" + zero(now.getMinutes()) + ":" + zero(now.getSeconds());
function zero(inNum){
inNum = "" + inNum //makes sure number is handles as string....
if(inNum.length == 1){
inNum = "0" + inNum
}
return inNum
}
alert (timestring)
</script> -- Just trying to help... <--- This is a wolf? We need a new icon.......
mikewolf@tst-us.com
Another way :
var date=new Date();
var strDate=new String(date.toLocaleTimeString());
alert ("strDate = " + strDate);
Water is not bad as long as it stays out human body ;-)
Much nicer than mine Targol (and easier) - Another star for you..... -- Just trying to help... <--- This is a wolf? We need a new icon.......
mikewolf@tst-us.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.