function checktime() {
  var thisday=new Date();
  var hour=thisday.getHours();
  if ((hour < 9) && (hour >=6))
    {document.write ("Guten Morgen!");}
  if ((hour < 12) && (hour >=9))
    {document.write ("Guten Tag!");}
  if ((hour >= 12) && (hour < 13))
    {document.write ("Mahlzeit!");}
  if ((hour >= 13) && (hour < 18))
    {document.write ("Guten Nachmittag?!");}
  if ((hour >=18) && (hour < 22))
    {document.write ("Guten Abend! Ich hoffe, Sie hatten einen guten Tag!");}
  if ((hour >=22) || (hour < 4))
    {document.write ("Es ist schon spät, Sie sollten ins Bett gehen!");}
  if ((hour >= 4) && (hour < 6))
    {document.write ("Es ist ziemlich früh, Sie sollten noch im Bett sein!");}
  document.write("<br>")  
}
