function Announcement::getDatePublishedTimestamp

Same name in other branches
  1. 11.x core/modules/announcements_feed/src/Announcement.php \Drupal\announcements_feed\Announcement::getDatePublishedTimestamp()

Gets the published date in timestamp format.

Return value

int Date published timestamp.

File

core/modules/announcements_feed/src/Announcement.php, line 64

Class

Announcement
Object containing a single announcement from the feed.

Namespace

Drupal\announcements_feed

Code

public function getDatePublishedTimestamp() {
    return DrupalDateTime::createFromFormat(DATE_ATOM, $this->date_published)
        ->getTimestamp();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.