about summary refs log tree commit diff
path: root/tools/when/when.go
diff options
context:
space:
mode:
Diffstat (limited to 'tools/when/when.go')
-rw-r--r--tools/when/when.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/when/when.go b/tools/when/when.go
index 3102328fe9..316f021913 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 {