Skip to content

Commit

Permalink
UTC timestamp tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
rw committed May 9, 2016
1 parent 9111be7 commit cf90987
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions bulk_query_gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func init() {

flag.StringVar(&dbName, "db", "benchmark_db", "Database for influx to use (ignored for elastic)")

flag.StringVar(&timestampStartStr, "timestamp-start", "2016-01-01T00:00:00-00:00", "Beginning timestamp (RFC3339).")
flag.StringVar(&timestampEndStr, "timestamp-end", "2016-01-01T06:00:00-00:00", "Ending timestamp (RFC3339).")
flag.StringVar(&timestampStartStr, "timestamp-start", "2016-01-01T00:00:00Z", "Beginning timestamp (RFC3339).")
flag.StringVar(&timestampEndStr, "timestamp-end", "2016-01-01T06:00:00Z", "Ending timestamp (RFC3339).")

flag.Int64Var(&seed, "seed", 0, "PRNG seed (default, or 0, uses the current timestamp).")
flag.IntVar(&debug, "debug", 0, "Debug printing (choices: 0, 1) (default 0).")
Expand Down Expand Up @@ -83,10 +83,12 @@ func init() {
if err != nil {
log.Fatal(err)
}
timestampStart = timestampStart.UTC()
timestampEnd, err = time.Parse(time.RFC3339, timestampEndStr)
if err != nil {
log.Fatal(err)
}
timestampEnd = timestampEnd.UTC()
}

func main() {
Expand Down
4 changes: 2 additions & 2 deletions bulk_query_gen/time_interval.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ func (ti *TimeInterval) RandWindow(window time.Duration) TimeInterval {

// StartString formats the start of the time interval.
func (ti *TimeInterval) StartString() string {
return ti.Start.Format(time.RFC3339)
return ti.Start.UTC().Format(time.RFC3339)
}

// EndString formats the end of the time interval.
func (ti *TimeInterval) EndString() string {
return ti.End.Format(time.RFC3339)
return ti.End.UTC().Format(time.RFC3339)
}

0 comments on commit cf90987

Please sign in to comment.