php8.5
Home/ Manual/ bson / timestamp/ MongoDB\BSON\Timestamp::__toString

MongoDB\BSON\Timestamp::__toString

PHP function Edit on GitHub ✎

(mongodb >=1.0.0)

Returns the string representation of this Timestamp

Description

MongoDB\BSON\Timestamp::__toString(): string

Parameters Parameters

Return Values

Returns the string representation of this Timestamp.

Examples

MongoDB\BSON\Timestamp::__toString() example

php
<?php

$timestamp = new MongoDB\BSON\Timestamp(1234, 5678);
var_dump((string) $timestamp);

?>

The above example will output something similar to:

output
string(11) "[1234:5678]"

See Also

  • BSON Types: Timestamps

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