Hour and Minutes togheter in Javascript
Topics related to client-side programming language.
Post questions and answers about JavaScript, Ajax, or jQuery codes and scripts.
-
JanMolendijk
- Posts:282
- Location:Holland Rotterdam
Hour and Minutes togheter in Javascript
Dear Coursesweb I can not find out how to add the hours + minutes togheter.
Code: Select all
<SCRIPT LANGUAGE="JavaScript">
day = new Date()
hr = day.getHours()
mn = day.getMinutes()
se = day.getSeconds()
</SCRIPT>
I would like to have both in one ???? hr + mn ????
Code: Select all
hr = day.getHours()
mn = day.getMinutes()
miho = hr,mn ?????????????????????
This is the exmple what is working seperated
Code: Select all
if (hr == 1) document.write("Het is na enen. nog niet naar bed?")
if (se == 1) document.write("<br>1 Wat gaat er gebeuren ?")
if (mn == 52) document.write("Na22222zessen. De afwas al gedaan?")
MarPlo
Posts:186
See and use the following example:
Code: Select all
<script>
var day = new Date();
let hr = day.getHours();
let mn = day.getMinutes();
let se = day.getSeconds();
let st_hm ='Hour: '+hr+', minutes: '+mn;
document.write(st_hm);
</script>
Similar Topics
- Display message to every minute in Javascript
JavaScript - jQuery - Ajax
First post
Hello,
On eatch minute from the current hour I wanna have an message
I can not find out how to complete
I hope to get something like this (code...
Last post
If you only want to display a message to every minute, just use the setInterval() function. It calls a function repeatedly, over and over again, at...