我已经存储了UUID v1作为密钥的数据,现在我想知道何时生成UUID。我该怎么做才好?
答案 0 :(得分:2)
这适用于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
感谢我的朋友KillerFox,他向我展示了简单的解决方案。