4 MINDS

4MINDS Gestão de Conhecimento

Go Lang Time - Date compare ignoring time




Use 

d := time.Now().Truncate(24*time.Hour)
other := time.Now().Truncate(24*time.Hour)

areEqual := other.Equal(d)

Or

d.Year() == other.Year() && d.YearDay() == other.YearDay()