class BSON::ObjectId

def timestamp

Returns:
  • (Integer) - the number of seconds since the Epoch.

Other tags:
    Note: - This value is guaranteed to be no more than 4 bytes in length. A
def timestamp
  ::Time.now.to_i % MAX_INTEGER
end