func parseTime(s string) (hour, minute int, err error) {
	switch s {
	case "midnight":
		return 0, 0, nil
	case "noon":
		return 12, 0, nil
	case "teatime":
		return 16, 0, nil
	}
	parts := strings.Split(s, ":")
	if len(parts) != 2 {
		return 0, 0, errBadTime
	}
	hour, err = strconv.Atoi(parts[0])
	if err != nil {
		return 0, 0, errBadTime
	}
	minute, err = strconv.Atoi(parts[1])
	if err != nil {
		return 0, 0, errBadTime
	}
	return hour, minute, nil
}
parseTime parses a time and returns hours and minutes
package date
import (
	"errors"
	"strconv"
	"strings"
	"time"
	"github.com/go-graphite/carbonapi/pkg/parser"
)
var errBadTime = errors.New("bad time")
var timeNow = time.Now