public function testToDateTime() { $date = new Date(2013, 1, 1); $this->assertEquals(new \DateTime('2013-01-01 00:00:00'), $date->toDateTime()); }
/** * Usecases: * - I want to display a date in custom format in templates. * */ public function testHowToConvertADddTimeDateObjectIntoRegularDateTimeObject() { $jan1 = new Date(2013, 1, 1); $this->assertEquals(new \DateTime('2013-01-01 00:00:00'), $jan1->toDateTime()); }