We're a place where coders share, stay up-to-date and grow their careers.
func daysBetween(a, b time.Time) float64 { if a.After(b) { a, b = b, a } return math.Ceil(b.Sub(a).Hours() / 24.0) }
Discussion on: Get the number of days between two dates in Go
Replies for: Not quite as robust as I'd like. Not all days have 24 hours in them. 😔