Display current time by using Date.getHours(), Date().getMinutes(), Date().getSeconds() : getMinutes : Date JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Date » getMinutes »

 

Display current time by using Date.getHours(), Date().getMinutes(), Date().getSeconds()

















<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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Date
» getMinutes