@ -82,7 +82,7 @@ func (t TimeOfDay) IsBetween(from TimeOfDay, to TimeOfDay) bool {
}
func CurrentTimeOfDay() TimeOfDay {
return TimeOfDayFromDate(time.Now())
return TimeOfDayFromDate(time.Now().Local())
func TimeOfDayFromDate(date time.Time) TimeOfDay {
@ -27,6 +27,8 @@ func TestTimeOfDay_IsBetween(t *testing.T) {
{ tod("04:13:57"), tod("21:30"), tod("07"), true },
{ tod("16:14:43"), tod("15:30"), tod("16:00"), false },
{ tod("16:14:43"), tod("15:30"), tod("16:15"), true },
{ tod("08:45:43"), tod("07:00:00"), tod("21:30:00"), true },
{ tod("07:00:00"), tod("07:00:00"), tod("21:30:00"), true },
for i, row := range table {