Пример #1
0
 /**
  * {@inheritdoc}
  */
 public static function offset($stamp, $offset)
 {
     return Calends::toInternalFromUnix(date_create_from_format('Y-m-d H:i:s.u P', date('Y-m-d H:i:s.u P', BC::round(Calends::fromInternalToUnix($stamp), 6)))->modify($offset)->format('U.u'));
 }
Пример #2
0
 /**
  * Gets the number of seconds between the start and end times
  *
  * @api
  *
  * @return float|integer
  **/
 public function getDuration($scale = 18)
 {
     return BC::round($this->duration, BC::intval($scale, 0));
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public static function fromInternal($stamp, $format = null)
 {
     $format = is_null($format) ? 18 : BC::max([BC::min([$format, 18], 0), 0], 0);
     return BC::round(Calends::fromInternalToUnix($stamp), $format);
 }