php8.5
Home/ Manual/ mongodb / bson/ The MongoDB\BSON\Timestamp class

The MongoDB\BSON\Timestamp class

Represents a BSON timestamp, The value consists of a 4-byte timestamp (i.e. seconds since the epoch) and a 4-byte increment.

Intro

Represents a BSON timestamp, The value consists of a 4-byte timestamp (i.e. seconds since the epoch) and a 4-byte increment.

Note

This is an internal MongoDB type used for replication and sharding. It is not intended for general date storage (MongoDB\BSON\UTCDateTime should be used instead).

Class synopsis

class MongoDB\BSON\Timestamp { }

Changelog

VersionDescription
PECL mongodb 1.12.0Implements Stringable for PHP 8.0+.
PECL mongodb 1.3.0Implements MongoDB\BSON\TimestampInterface.
PECL mongodb 1.2.0Implements Serializable and JsonSerializable.

Timestamp

In this section

Source: reference/mongodb/bson/timestamp.xml · from the official PHP manual (php/doc-en)