From 431937d0fe2ee51e61f0f615d3d0506bf6adac84 Mon Sep 17 00:00:00 2001 From: Sam Therapy Date: Fri, 16 Dec 2022 00:07:27 +0100 Subject: [PATCH] make time more correct Signed-off-by: Sam Therapy --- pkg/query/print.go | 3 +-- pkg/query/struct.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/query/print.go b/pkg/query/print.go index 9842855..3179924 100644 --- a/pkg/query/print.go +++ b/pkg/query/print.go @@ -255,9 +255,8 @@ func MakePrintable(res util.Response, opts *util.Options) (*Message, error) { ret := &Message{ RTT: res.RTT.String(), Server: opts.Request.Server + serverExtra(opts), - When: time.Now().Format(time.RFC3339), DateString: time.Now().Format(time.RFC3339), - DateSeconds: time.Now().Format(time.UnixDate), + DateSeconds: time.Now().Unix(), MsgSize: res.DNS.Len(), ID: msg.Id, Opcode: dns.OpcodeToString[msg.Opcode], diff --git a/pkg/query/struct.go b/pkg/query/struct.go index 1225374..1dc5b58 100644 --- a/pkg/query/struct.go +++ b/pkg/query/struct.go @@ -11,7 +11,7 @@ import ( //nolint:govet,tagliatelle // Better looking output is worth a few bytes. type Message struct { DateString string `json:"dateString,omitempty" xml:"dateString,omitempty" yaml:"dateString,omitempty"` - DateSeconds string `json:"dateSeconds,omitempty" xml:"dateSeconds,omitempty" yaml:"dateSeconds,omitempty"` + DateSeconds int64 `json:"dateSeconds,omitempty" xml:"dateSeconds,omitempty" yaml:"dateSeconds,omitempty"` MsgSize int `json:"msgLength,omitempty" xml:"msgSize,omitempty" yaml:"msgSize,omitempty"` ID uint16 `json:"id," xml:"id," yaml:"id" example:"12"`