Method: BSON::ObjectId.timestamp
- Defined in:
- lib/bson/object_id.rb
.timestamp ⇒ Integer
Note:
This value is guaranteed to be no more than 4 bytes in length. A time value far enough in the future to require a larger integer than 4 bytes will be truncated to 4 bytes.
Returns an integer timestamp (seconds since the Epoch). Primarily used by the generator to produce object ids.
373 374 375 |
# File 'lib/bson/object_id.rb', line 373 def ::Time.now.to_i % MAX_INTEGER end |