I want to change css by get user time. if the Time now is 06:00-12:00 get the Morning style. time 12:00-18:00 get the Afternoon Style. Time 18:00-06:00 get the Night Style. else get the Normal Style... how to do that.
function morning() {
document.getElementsByTagName('BODY')[0].style.backgroundColor = "#fcfcfc";
document.getElementsByTagName('BODY')[0].style.color = "#505050";
}
function afternoon() {
document.getElementsByTagName('BODY')[0].style.backgroundColor = "gainsboro";
document.getElementsByTagName('BODY')[0].style.color = "black";
}
function night() {
document.getElementsByTagName('BODY')[0].style.backgroundColor = "#1b1b1b";
document.getElementsByTagName('BODY')[0].style.color = "#fff";
}
function normal() {
document.getElementsByTagName('BODY')[0].style.backgroundColor = "#fff";
document.getElementsByTagName('BODY')[0].style.color = "#1b1b1b";
}