$utcdatetime = new MongoDB\BSON\UTCDateTime($unixtimestamp * 1000);
(mongodb >=1.0.0)
MongoDB\BSON\UTCDatetime::__construct — Description
$milliseconds
)
milliseconds
Приклад #1 MongoDB\BSON\UTCDatetime::__construct() example
<?php
/* ... */
?>
Наведений вище приклад виведе щось подібне до:
...
$utcdatetime = new MongoDB\BSON\UTCDateTime($unixtimestamp * 1000);
For me to get it work with php 5.6 on an iis 7.5, it had to be a string
$utcdatetime = new MongoDB\BSON\UTCDateTime('1416445411987');
The problem with integer => string is only on 32 bit systems