1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-20 21:02:05 +02:00

added dibi::stripMicroseconds

This commit is contained in:
David Grudl
2018-04-18 13:43:11 +02:00
parent 10324322be
commit 030554e1ae
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
use Tester\Assert;
require __DIR__ . '/bootstrap.php';
$dt = new DateTime('2018-04-18 13:40:09.123456');
$res = dibi::stripMicroseconds($dt);
Assert::same('2018-04-18 13:40:09.123456', $dt->format('Y-m-d H:i:s.u'));
Assert::same('2018-04-18 13:40:09.000000', $res->format('Y-m-d H:i:s.u'));