File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,10 @@ public function toNative($opts)
67
67
if ((!isset ($ opts ['timeFormat ' ]) || $ opts ['timeFormat ' ] == "native " )
68
68
&& isset ($ native ['$reql_type$ ' ]) && $ native ['$reql_type$ ' ] == 'TIME ' ) {
69
69
$ time = $ native ['epoch_time ' ];
70
- $ format = (strpos ($ time , '. ' ) !== false ) ? 'Y-m-d H:i:s.u ' : 'Y-m-d H:i:s ' ;
71
- $ datetime = new \DateTime (date ($ format , $ time ) . $ native ['timezone ' ], new \DateTimeZone ('UTC ' ));
70
+ $ format = (strpos ($ time , '. ' ) !== false ) ? '!U.u T ' : '!U T ' ;
71
+ $ datetime = \DateTime::createFromFormat ($ format , $ time . " " . $ native ['timezone ' ], new \DateTimeZone ('UTC ' ));
72
+ //$format = (strpos($time, '.') !== false) ? 'Y-m-d H:i:s.u' : 'Y-m-d H:i:s';
73
+ //$datetime = new \DateTime(date($format, $time) . $native['timezone'], new \DateTimeZone('UTC'));
72
74
73
75
// This is horrible. Just because in PHP 5.3.something parsing "+01:00" as a date interval doesn't work. :(
74
76
$ tzSign = $ native ['timezone ' ][0 ];
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public function testPositive()
48
48
49
49
public function testFloatMax ()
50
50
{
51
- $ this ->assertEquals ( (float )PHP_INT_MAX , \r \expr (( float ) PHP_INT_MAX )->run ($ this ->conn ));
51
+ $ this ->assertLessThan ( 10 , (float )PHP_INT_MAX - \r \expr (PHP_INT_MAX )->run ($ this ->conn ));
52
52
}
53
53
54
54
public function testString ()
You can’t perform that action at this time.
0 commit comments