Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. GPBUtil.php

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

GPBUtil

Namespace

Google\Protobuf\Internal

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal