Skip to content

Commit 9e901e3

Browse files
author
Илья
committed
Update TimestampType.php and QueryResult.php
1 parent b153a02 commit 9e901e3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/QueryResult.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ protected function fillRows($rows)
195195

196196
case 'TIMESTAMP':
197197
if(is_numeric($value)){
198-
$date = DateTime::createFromFormat('U.u', $value/1000000);
198+
$value = number_format($value*1.0/1000000.0,6,'.','');
199+
$date = DateTime::createFromFormat('U.u', $value);
199200
$_row[$column['name']] = $date->format('Y-m-d H:i:s.u');
200201
} else {
201202
$_row[$column['name']] = $value;

src/Types/TimestampType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ protected function getYqlString()
2929
protected function getYdbValue()
3030
{
3131
$value = new DateTime($this->value);
32-
return $value->getTimestamp() * 1000000;
32+
return $value->format("U.u") * 1000000;
3333
}
3434
}

0 commit comments

Comments
 (0)