Skip to content

Exp time using RFC3339 causes different value to be saved #15

Closed Answered by aidantwoods
andrei-cdl asked this question in Q&A
Discussion options

You must be logged in to vote

This falls under expected behaviour because the PASETO spec specifies that RFC 3339 be used for times.

I agree that this creates a somewhat surprising result when running tests to check the time is the same, although in practice I think this is unlikely to cause issues (given it's more interesting to compare orderings of times than their exact value).

If you need to check two times are equal for the purpose of tests, I'd recommend comparing the unix timestamp (which is in seconds) using t.Unix() 🙂

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by aidantwoods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #14 on January 09, 2023 22:50.