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

Breadcrumb

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

function TimestampBase::fromDateTime

File

vendor/google/protobuf/src/Google/Protobuf/Internal/TimestampBase.php, line 16

Class

TimestampBase
Base class for Google\Protobuf\Timestamp, this contains hand-written convenience methods.

Namespace

Google\Protobuf\Internal

Code

public function fromDateTime(\DateTime $datetime) {
    $this->seconds = $datetime->getTimestamp();
    $this->nanos = 1000 * $datetime->format('u');
}

API Navigation

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