Say good moring / day / afternoon
<script language="JavaScript">
var myDate = new Date();
if ( myDate.getHours() < 12 ) { /* before noon */
document.write("Bonjour");
}
else if ( myDate.getHours() >= 12 && myDate.getHours() <= 17 ) { /* from noon to 5:39pm */
document.write("Bonsoir");
}
else if ( myDate.getHours() > 17 && myDate.getHours() <= 24 ) { /* 6pm and midnight */
document.write("Bonsoir");
}
else { document.write("Bonjour"); } /* not between 0 and 24, so something is wrong */
</script>