예제 #1
0
 public function instant()
 {
     if ($this->tickNanos % 1000000 == 0) {
         $millis = $this->baseClock->millis();
         return Instant::ofEpochMilli($millis - Math::floorMod($millis, $this->tickNanos / 1000000));
     }
     $instant = $this->baseClock->instant();
     $nanos = $instant->getNano();
     $adjust = Math::floorMod($nanos, $this->tickNanos);
     return $instant->minusNanos($adjust);
 }
예제 #2
0
 public function instant()
 {
     return Instant::ofEpochMilli($this->millis());
 }
예제 #3
0
 /**
  * @expectedException \Celest\DateTimeException
  * @dataProvider data_badPlusTemporalAmount
  */
 public function test_badPlusTemporalAmount(TemporalAmount $amount)
 {
     $inst = Instant::ofEpochMilli(1000);
     $inst->plusAmount($amount);
 }