Serialize a Timestamp

- « MongoDB\BSON\Timestamp::jsonSerialize

- MongoDB\BSON\Timestamp::__toString »

- PHP Manual
- MongoDB\BSON\Timestamp
- Serialize a Timestamp

# MongoDB\BSON\Timestamp::serialize

(mongodb >=1.2.0)

MongoDB\BSON\Timestamp::serialize — Serialize a Timestamp

### Description

final public MongoDB\BSON\Timestamp::serialize(): string

### Parameters

This function has no parameters.

### Return Values

Returns the serialized representation of the MongoDB\BSON\Timestamp.

### Errors/Exceptions

- Throws MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors.

### See Also

- MongoDB\BSON\Timestamp::unserialize() - Unserialize a Timestamp
- serialize() - Generates a storable representation of a value
- Serializing Objects