title: Compare only date part ot time.Time in Golang
body: <p>Assume the following two dates. The date is the same, however the time is different.</p>
  
  <pre><code>t1, _ := time.Parse("2006-01-02 15:04:05", "2016-01-01 12:12:12.0")
  t2, _ := time.Parse("2006-01-02 15:04:05", "2016-01-01 18:19:20.0")
  </code></pre>
  
  <p>I would compare them using <code>Format()</code>, but am not sure if that's the best way, especially when different timezones are at play.</p>
  
  <pre><code>if t1.Format("2006-01-02") == t2.Format("2006-01-02") {
      // dates are equal, don't care about time.
  }
  </code></pre>
  
  <p>Is this a good approach, or am I missing something?</p>