<html>
<head>
<title>Convert Time</title>
</head>
<body>
<script language="JavaScript" type="text/javascript">
<!--
var current_date = new Date();
var hour_value = current_date.getHours();
var minute_value = current_date.getMinutes();
var second_value = current_date.getSeconds();
var AMorPM = "AM";
if (hour_value > 12)
{
hour_value -= 12;
AMorPM = "PM";
}
document.write("The current time is " + hour_value + ":" + minute_value +
":" + second_value + " " + AMorPM);
//-->
</script>
</body>
</html>
|