public function testDateBeforeUnixTime() { $date = DateTime::createFromFormat('d.m.Y u', '06.06.1799 654321'); $nativeDate = $date->asNativeDate(); $this->assertNotFalse($nativeDate); $this->assertNotFalse($date->asDate()); $this->assertEquals($date->format(DateTime::FULL_ISO8601), $nativeDate->format(DateTime::FULL_ISO8601)); }
public function testFormatToIso() { $date = DateTime::createFromFormat('U.u', (string) microtime(true)); $this->assertStringEndsNotWith('.000000+0000', $date->toIsoString()); }