logo

systemTime (hh:mm:ss) (Javascript)

JavaScript: The Definitive Guide
Subject: systemTime returns the local systems hours, minutes, and seconds
from the system clock.

function systemTime()
{
	var now;
	var stTime;
	now= new Date();
	if (now.getHours()>12)
	{
		stTime=(now.getHours()-12)+":"+now.getMinutes()+":"+now.getSeconds()+" p.m";
	}
	else
	{
		stTime=now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()+ "a.m";
	}
	return(stTime);
}
s