Skip to content

Commit 02d4828

Browse files
authored
Fix #385: Fix yii\base\ErrorException: MongoDB\BSON\UTCDateTime::__construct(): Creating a MongoDB\BSON\UTCDateTime instance with a float is deprecated and will be removed in ext-mongodb 2.0
1 parent 766dfa5 commit 02d4828

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Yii Framework 2 mongodb extension Change Log
66

77
- Bug #379, #382: Fixed usage of `getId` method in BatchQueryResult and Cursor classes to match changes in MongoDB PHP Extension 1.20.1 (shaperman)
88
- Chg: MongoDB PHP extension min version raised up to 1.20.1 (shaperman)
9+
- Bug #385: Fix `yii\base\ErrorException: MongoDB\BSON\UTCDateTime::__construct(): Creating a MongoDB\BSON\UTCDateTime instance with a float is deprecated and will be removed in ext-mongodb 2.0` (asminog)
910

1011

1112
3.0.2 February 13, 2025

src/file/Upload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ private function insertFile()
256256
{
257257
$fileDocument = [
258258
'_id' => $this->_documentId,
259-
'uploadDate' => new UTCDateTime(round(microtime(true) * 1000)),
259+
'uploadDate' => new UTCDateTime(),
260260
];
261261
if ($this->filename === null) {
262262
$fileDocument['filename'] = $this->_documentId . '.dat';

0 commit comments

Comments
 (0)