diff --git a/z/exportCmd.go b/z/exportCmd.go index 449db04..b8e8827 100644 --- a/z/exportCmd.go +++ b/z/exportCmd.go @@ -5,6 +5,7 @@ import ( "fmt" "time" "encoding/json" + "github.com/jinzhu/now" "github.com/spf13/cobra" ) @@ -48,7 +49,7 @@ var exportCmd = &cobra.Command{ var untilTime time.Time if since != "" { - sinceTime, err = time.Parse(time.RFC3339, since) + sinceTime, err = now.Parse(since) if err != nil { fmt.Printf("%s %+v\n", CharError, err) os.Exit(1) @@ -56,7 +57,7 @@ var exportCmd = &cobra.Command{ } if until != "" { - untilTime, err = time.Parse(time.RFC3339, until) + untilTime, err = now.Parse(until) if err != nil { fmt.Printf("%s %+v\n", CharError, err) os.Exit(1) diff --git a/z/listCmd.go b/z/listCmd.go index 1046328..35c114a 100644 --- a/z/listCmd.go +++ b/z/listCmd.go @@ -5,6 +5,7 @@ import ( "os" "time" + "github.com/jinzhu/now" "github.com/shopspring/decimal" "github.com/spf13/cobra" ) @@ -32,7 +33,7 @@ var listCmd = &cobra.Command{ var untilTime time.Time if since != "" { - sinceTime, err = time.Parse(time.RFC3339, since) + sinceTime, err = now.Parse(since) if err != nil { fmt.Printf("%s %+v\n", CharError, err) os.Exit(1) @@ -40,7 +41,7 @@ var listCmd = &cobra.Command{ } if until != "" { - untilTime, err = time.Parse(time.RFC3339, until) + untilTime, err = now.Parse(until) if err != nil { fmt.Printf("%s %+v\n", CharError, err) os.Exit(1)