-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TimestampFromV7 should return the unix timestamp in milliseconds #128
Comments
I didn't write the existing implementation, but it looks like it's reusing the |
Ahh, should we expect each parser to return its draft-compliant timestamp though? Happy to draft that PR if you think so! |
That would imply creating a separate |
Or separate by epoch
|
That would be a breaking change to everything currently using I'm certainly not the final arbiter but I'd argue for leaving this as is. |
I mean you could mark
I expected that parsing a UUID v7 would yield a Unix timestamp w/ millisecond precision, as this was a deliberate design choice by the UUID authors. |
Might I suggest having two "from v7" functions here?
Thoughts? |
Hi, chiming in. I think it's a better developer experience to offer a neutral, consistent timestamp type and allow the developer to convert as needed. Understood it's not compliant to spec in a technical sense. I'll close the issue but please feel free to continue discussing. Thanks for the feedback! |
For some users, there may be a performance reason to have a native
Admittedly, for most of us the difference between 3.022ns (fastest native run) and 5.481ns (slowest two-step run) is not going to be noticeable, but I am sure there are some people for whom it makes a difference. |
Apologies if I am missing something, but it appears the current implementation of
TimestampFromV7()
uses the Gregorian epoch timestamp as opposed to unix:uuid/uuid.go
Line 156 in 22c52c2
uuid/generator.go
Lines 37 to 39 in 22c52c2
The draft states:
So shouldn't this be:
Where tests would be as straightforward as:
The text was updated successfully, but these errors were encountered: