title: How to run a job on a specific time every day?
body: <p>I want to print out <code>do my job</code> every day at 9pm. How can I do this in Go?</p>
  <p>Here's what I've got so far:</p>
  <pre class="lang-golang prettyprint-override"><code>timer := time.NewTimer(3 * time.Second)
  for {
      now := time.Now()
      next := now.Add(time.Hour * 24)
      todayNine := time.Date(next.Year(), next.Month(), next.Day(), 9, 0, 0, 0, next.Location()).AddDate(0, 0, -1)
      todayFifteen := time.Date(next.Year(), next.Month(), next.Day(), 15, 0, 0, 0, next.Location()).AddDate(0, 0, -1)
      todayEnd := time.Date(next.Year(), next.Month(), next.Day(), 0, 0, 0, 0, next.Location()).AddDate(0, 0,  -1)
      if now.Before(todayNine) {
          timer.Reset(todayNine.Sub(now))
      } else if now.Before(todayFifteen) {
          timer.Reset(todayFifteen.Sub(now))
      } else if now.Before(todayEnd) {
          timer.Reset(todayEnd.Sub(now))
      }
      &lt;- timer.C
      fmt.Println(&quot;do my job&quot;)
  }
  </code></pre>