You are here

public function Simplesitemap::get_generated_ago in Simple XML sitemap 8

Returns a 'time ago' string of last timestamp generation.

Return value

mixed Formatted timestamp of last sitemap generation, otherwise FALSE.

File

src/Simplesitemap.php, line 250
Contains \Drupal\simplesitemap\Simplesitemap.

Class

Simplesitemap
Simplesitemap class.

Namespace

Drupal\simplesitemap

Code

public function get_generated_ago() {
  if (isset($this->sitemap[0]->sitemap_created)) {
    return \Drupal::service('date.formatter')
      ->formatInterval(REQUEST_TIME - $this->sitemap[0]->sitemap_created);
  }
  return FALSE;
}