Skip to content

Commit

Permalink
added suport for unix timestamp values on -start and -end parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
toni-moreno committed Jun 8, 2019
1 parent 82e60ca commit a966d8f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/util.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package main

import (
"strconv"
"strings"
"time"
)

func parseInputTime(t string) (time.Time, error) {
//check if a negative duration.
var T time.Time
if i, err := strconv.ParseInt(t, 10, 32); err == nil {
return time.Unix(i, 0), nil
}
if strings.HasPrefix(t, "-") {
//parse as duration
dur, err := time.ParseDuration(t)
Expand Down

0 comments on commit a966d8f

Please sign in to comment.