Можно
<script language="JavaScript">
function process(){}
today = new Date()
if((today.getHours() < 3) && (today.getHours() >= 9))
{ document.write("Доброе утро,")}
if((today.getHours() >= 9) && (today.getHours() < 17))
{ document.write("Добрый день,")}
if((today.getHours() >= 17) && (today.getHours() <= 23))
{ document.write("Добрый вечер,")}
if((today.getHours() >= 0) && (today.getHours() <= 3))
{ document.write("Доброй ночи,")}
</script>