我存储了一个以UUID v1作为键的数据,现在我想知道这个UUID是何时生成的。有什么好方法可以做到吗?
这在irb中有效:
require 'simple_uuid'
uuid = SimpleUUID::UUID.new
uuid.to_guid # actually this is what I have stored in my database
Time.at(SimpleUUID::UUID.new(uuid.to_guid).seconds) # returns the time and date of the UUID