Method: Moped::BSON::ObjectId#generation_time

Defined in:
lib/moped/bson/object_id.rb

#generation_timeObject

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.



65
66
67
# File 'lib/moped/bson/object_id.rb', line 65

def generation_time
  Time.at(data.unpack("N")[0]).utc
end