Skip to content

Commit

Permalink
add some constants
Browse files Browse the repository at this point in the history
  • Loading branch information
withinboredom committed Mar 21, 2024
1 parent 2e590f6 commit 182d0bb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/AnyTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ public function subtract(AnyTime $time): AnyTime
return self::fromValue($result, $time->spacetime);
}

public function multiply(float $times): AnyTime
{
return self::fromValue($this->value * $times, $this->spacetime);
}

public function toDateInterval(): \DateInterval
{
$obj = $this;
Expand Down
9 changes: 9 additions & 0 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,12 @@ function Weeks(float $time, TimeAndSpaceInterface|null $spacetime = null): AnyTi
{
return ($spacetime ?? StandardEarthTime::duration())->fromWeeks($time);
}

define('StandardNanosecond', Nanoseconds(1));
define('StandardMicrosecond', Microseconds(1));
define('StandardMillisecond', Milliseconds(1));
define('StandardSecond', Seconds(1));
define('StandardMinute', Minutes(1));
define('StandardHour', Hours(1));
define('StandardDay', Days(1));
define('StandardWeek', Weeks(1));

0 comments on commit 182d0bb

Please sign in to comment.