/** * @covers Marando\AstroDate\Epoch::toDate */ public function testToDate() { $dt = Epoch::J2000()->toDate(); $expected = AstroDate::jd(2451545.0, TimeScale::TT()); $this->assertEquals($expected->toJD(), $dt->toJD()); }
/** * Converts this instance to an AstroDate instance * @return AstroDate */ public function toDate() { if ($this->dt) { return $this->dt; } else { return AstroDate::jd($this->jd, TimeScale::TT()); } }
/** * @covers Marando\AstroDate\TimeScale::__toString */ public function test__toString() { $this->assertEquals('UTC', (string) TimeScale::UTC()); }