-
Line 71 in 8ab6606 func (date NumericDate) MarshalJSON() (b []byte, err error) {
var prec int
if TimePrecision < time.Second {
prec = int(math.Log10(float64(time.Second) / float64(TimePrecision)))
}
truncatedDate := date.Truncate(TimePrecision)
seconds := strconv.FormatInt(truncatedDate.Unix(), 10)
nanosecondsOffset := strconv.FormatFloat(float64(truncatedDate.Nanosecond())/float64(time.Second), 'f', prec, 64)
output := append([]byte(seconds), []byte(nanosecondsOffset)[1:]...)
return output, nil
} Only support seconds here. How can we measure in milliseconds (*1000)? If I change |
Beta Was this translation helpful? Give feedback.
Answered by
oxisto
Dec 15, 2023
Replies: 1 comment 1 reply
-
You can't. The unit of
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
oxisto
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can't. The unit of
exp
is fixed to seconds. The type of the field is aNumericDate
, which is defined in https://datatracker.ietf.org/doc/html/rfc7519#section-2 as: