Lines Matching refs:nanoseconds
418 $nanoseconds = 0;
437 $nanoseconds = substr($timestamp, $periodIndex + 1, $nanosecondsLength);
438 $nanoseconds = intval($nanoseconds);
455 $value->setNanos($nanoseconds);
467 $nanoseconds = static::getNanosecondsForTimestamp($value->getNanos());
468 if (!empty($nanoseconds)) {
469 $nanoseconds = ".".$nanoseconds;
472 return $date->format("Y-m-d\TH:i:s".$nanoseconds."\Z");
577 public static function getNanosecondsForTimestamp($nanoseconds) argument
579 if ($nanoseconds == 0) {
582 if ($nanoseconds % static::NANOS_PER_MILLISECOND == 0) {
583 return sprintf('%03d', $nanoseconds / static::NANOS_PER_MILLISECOND);
585 if ($nanoseconds % static::NANOS_PER_MICROSECOND == 0) {
586 return sprintf('%06d', $nanoseconds / static::NANOS_PER_MICROSECOND);
588 return sprintf('%09d', $nanoseconds);