Same name and namespace in other branches
  1. 8.9.x core/modules/node/src/Entity/Node.php \Drupal\node\Entity\Node::getCreatedTime()
  2. 9 core/modules/node/src/Entity/Node.php \Drupal\node\Entity\Node::getCreatedTime()

Gets the node creation timestamp.

Return value

int Creation timestamp of the node.

Overrides NodeInterface::getCreatedTime

File

core/modules/node/src/Entity/Node.php, line 217

Class

Node
Defines the node entity class.

Namespace

Drupal\node\Entity

Code

public function getCreatedTime() {
  return $this
    ->get('created')->value;
}