go
/
misc
1
0
Fork 0
misc/dttm/between.go

11 lines
270 B
Go
Raw Permalink Normal View History

2022-03-21 22:13:57 +09:00
package dttm
import (
"time"
)
//BetweenTwoDates is a function that checks if a given date is between a start date and an end date.
func BetweenTwoDates(target, start, end time.Time) bool {
return (start.Before(target) || start.Equal(target)) && end.After(target)
}