.js help with the Date object and if/else
<p>ok so im trying to create something where certain elements change based on time of day. that time of day is gotten via system clock.</p>

<p>heres my code:</p>

<pre><code>var currTime = new Date();


var currHrs = currTime.getHours();
var currMins = currTime.getMinutes();
var currSecs = currTime.getSeconds();



if (currMins &lt; 10){
  currMins = "0" + currMins;
}


var suffix = "AM";
  if (currHrs &gt;= 12) {
  suffix = "PM";
  currHrs = currHrs - 12;
  }
  if (currHrs == 0) {
  currHrs = 12;
  }



//display thr and minutes .
var myTime = currHrs + ":" + currMins;



if(myTime&lt; 12){
document.getElementById("clock").innerHTML = myTime;    
} else {
    //code here

}
</code></pre>

<p>problem im having is that the time isnt being written at all in the html "clock" div.
i know it works because if i take out the 'if' and just do the document.write etc, its prints to screen.</p>

<p>im assuming that the problem is the myTime > 12 part. if i do '>' or '&lt;' , it still doesnt work.</p>

<p>what i want is that say for example, if its before 12pm something happens, etc. i just dont know how to target for example, morning time from noon, night etc.</p>

<p>any ideas, etc ill gladly appreciate.</p>

<p>thanks in advanced.</p>

<p></p>
