In the documentation indicated that the constructor takes an integer parameter representing the timestamp in milliseconds, you provide a timestamp in seconds, an incorrect result.
Multiply the value by 1000 to get the timestamp in milliseconds, so return a valid datetime object converted by:
$timestamp = 1453939200 * 1000; $utcdatetime = new MongoDB\BSON\UTCDateTime($timestamp); $datetime = $utcdatetime->toDateTime(); var_dump($datetime);
chridam
source share