diff --git a/tools/when/when.go b/tools/when/when.go index 3102328fe..316f02191 100644 --- a/tools/when/when.go +++ b/tools/when/when.go @@ -4,6 +4,7 @@ import ( "fmt" "os" "strconv" + "strings" "time" ) @@ -107,6 +108,13 @@ func main() { var err error var haveTime, haveDuration bool + // Try to parse entire input as one full thing, before getting more + // clever. + if t, err = parseTime(strings.Join(os.Args[1:], " ")); err == nil { + printTime(t) + return + } + for _, arg := range os.Args[1:] { if !haveTime { if t, err = parseTime(arg); err == nil {