/** @test */ public function it_can_get_a_new_datetime() { $loom = Loom::make()->fromDateTime(new DateTime('now')); $loom->add(Loom::make()->fromDays(2)); $dateTime = $loom->getDateTime(); $this->assertEquals((new DateTime('now + 2 days'))->format('d'), $dateTime->format('d')); }
/** * Get time since * * @return Loom */ public function since() { $now = (new \DateTime('now'))->getTimestamp(); $since = $this->diff(Loom::make()->fromSeconds($now)); return $since; }