Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<script src="//cdnjs.cloudflare.com/ajax/libs/processing.js/1.4.1/processing-api.min.js"></script><script>
var now = new Date();
var hrs = now.getHours();
var msg = "";
if (hrs >=  0){
  alert("Mornin' Sunshine!");
} elseif (hrs >  15){
  alert("Good morning");
} elseif (hrs > 12){
  alert("Good afternoon");
} elseif (hrs > 17){
  alert("Good evening");
} elseif (hrs > 22){
  alert("Go to bed!");
}
</script>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers