Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
function todayDate(){
  var day;
  switch(new Date().getDay()){
      case 0:
        day = "Sunday";
        break;
    case 1:
      day = "Monday";
      break;
    case 2: 
      day = "Tuesday";
      break;
    case 3:
      day = "Wednesday";
      break;
    case 4: 
      day = "Thursday";
      break;
    case 5: 
      day = "Friday";
      break;
    case 6: 
      day = "Saturday";
      break;
    default: 
      day = "The day is not known my friend";
  }
  return day;
}
function todayTime(){
  var timee = (new Date()).getHours() + ' : ' + (new Date()).getMinutes() + ' : ' + (new Date()).getSeconds();
  return timee;
}
function todayTime(){
  var hrs = (new Date()).getHours();
  var minutes = (new Date()).getMinutes();
  var seconds = (new Date()).getSeconds();
  var ampm = hrs >= 12 ? 'pm' : 'am';
  hrs = hrs % 12;
  hrs = hrs ? hrs : 12
}
document.getElementById('main-content').innerHTML = 'Today is : ' + todayDate() + '<br>' + 'Current time is: ' + todayTime();
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers