function GPBUtil::getNanosecondsForTimestamp
1 call to GPBUtil::getNanosecondsForTimestamp()
- GPBUtil::formatTimestamp in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ GPBUtil.php
File
-
vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ GPBUtil.php, line 606
Class
Namespace
Google\Protobuf\InternalCode
public static function getNanosecondsForTimestamp($nanoseconds) {
if ($nanoseconds == 0) {
return '';
}
if ($nanoseconds % static::NANOS_PER_MILLISECOND == 0) {
return sprintf('%03d', $nanoseconds / static::NANOS_PER_MILLISECOND);
}
if ($nanoseconds % static::NANOS_PER_MICROSECOND == 0) {
return sprintf('%06d', $nanoseconds / static::NANOS_PER_MICROSECOND);
}
return sprintf('%09d', $nanoseconds);
}