/
githubmirror
/
ydb-php-sdk
Обзор
Документация
Войти
/
githubmirror
/
ydb-php-sdk
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Types/TimestampType.php
34 строки
625 B
Илья
Update TimestampType.php and QueryResult.php
28 июл 2023, 16:09
28 июл 2023, 16:09
9e901e3
Код
Авторство
О чём код?
<?php namespace YdbPlatform\Ydb\Types; use DateTime; use Exception; class TimestampType extends DatetimeType { /** * @var string */ protected static $datetime_format = 'Y-m-d\TH:i:s.u\Z'; protected $ydb_key_name = "uint64_value"; protected $ydb_type = "TIMESTAMP"; /** * @inherit */ protected function getYqlString() { return 'Timestamp(' . $this->quoteString($this->value) . ')'; } /** * @inherit */ protected function getYdbValue() { $value = new DateTime($this->value); return $value->format("U.u") * 1000000; } }