Method: BSON::ObjectId#generation_time
- Defined in:
- lib/bson/object_id.rb
#generation_time ⇒ Time
Return the UTC time at which this ObjectId was generated. This may be used instread of a created_at timestamp since this information is always encoded in the object id.
102 103 104 |
# File 'lib/bson/object_id.rb', line 102 def generation_time ::Time.at(to_bson.unpack("N")[0]).utc end |