+ 16
Real Time Clock.
I don't Know how to i make a Real time clock , like a It's Show me If time is 12:00:00 am (Midnight) If time is 04:00:00 am (Early Morning) If time is 06:00:00 am (Morning) If time is 12:00:00 pm (Afternoon) If time is 04:00:00 pm (Close to Evening) If time is 06:00:00 pm (Evening) If time is 09:00:00 pm (Night) How to i make this clock ????
7 Answers
+ 6
U can make it in an easy way using js function
https://code.sololearn.com/W32EC03bI267/?ref=app
+ 5
An example with html and php clock:
https://code.sololearn.com/w2yqPJJ8ew39/?ref=app
+ 4
Ayesha Noor
You can make Clock and then after getting hours, minutes, seconds and 'AM' or 'PM' you can compare with value to print given String like this:
function compareWitTime(hours, minutes, seconds, dn) {
if(minutes != '00' || seconds != '00')
return "";
if(hours == 12 && dn == 'AM')
return "Midnight";
else if(hours == 4 && dn == 'AM')
return "Early Morning";
}
Here is reference:
https://code.sololearn.com/WA51A5a9A44a/?ref=app
+ 2
https://code.sololearn.com/WOvVf7KAOK1x/?ref=app
Use it becoz its simple and easy to use
Supported by almost all browsers except internet explorer older versions..
+ 1
https://code.sololearn.com/W9L409X3Y8KT/?ref=app