make time more correct
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2022-12-16 00:07:27 +01:00
parent 4d1240cc77
commit 431937d0fe
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD
2 changed files with 2 additions and 3 deletions

View file

@ -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],

View file

@ -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"`