Skip to content
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

Ability to encode specific timestamp into a V1 UUID #84

Closed
rkuris opened this issue Apr 24, 2020 · 3 comments
Closed

Ability to encode specific timestamp into a V1 UUID #84

rkuris opened this issue Apr 24, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@rkuris
Copy link
Contributor

rkuris commented Apr 24, 2020

Hi,

I have a need to encode a specific timestamp (instead of time.Now()) into a V1 UUID. There doesn't seem to be a way to do that. Before I start coding the change for that, I'm checking to see if this is something that is generally useful or if I should just maintain my own code to do this.

Thoughts?

@cameracker
Copy link
Collaborator

This strikes me as a useful bit of functionality and wouldn't be a major expansion to the API. Maybe something like

NewV1FromTimestamp(t time.Time)

@cameracker cameracker added the enhancement New feature or request label Jan 26, 2023
@adiatma85
Copy link

adiatma85 commented Jul 7, 2023

Do we need a function to decode the UUID to got the specific time?

I think it's good enough to got that timestamp from UUID as well

@cameracker
Copy link
Collaborator

This has been closed in #142

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants