Q:

Is there a way I could get auto string from HTML depending on time

I'm looking for a solution similar to SQL in html
For example in SQL
Case when date between 00:00:00 and 12:00:00 then "morning"
else "afternoon"
end as Morning/afternoon

A:

Try this in Java script tag:
    var myDate = new Date();
    var hrs = myDate.getHours();
    var greet;

    if (hrs >= 12 && hrs <= 11.59)
        greet = 'Good Morning';
    else if (hrs >= 12 && hrs <= 17)
        greet = 'Good Afternoon';
    else if (hrs >= 17 && hrs <= 24)
        greet = 'Good Evening';

    document.getElementById('TIME').innerHTML = greet;

