You are here

public function SiteAlert::getStartTime in Site Alert 8

File

src/Entity/SiteAlert.php, line 94

Class

SiteAlert
Implements SiteAlert class.

Namespace

Drupal\site_alert\Entity

Code

public function getStartTime() {
  if ($start_time = $this
    ->get('scheduling')->value) {
    $date = new DrupalDateTime($start_time, 'UTC');
    return $date
      ->format('Y-m-d H:i:s', [
      'timezone' => date_default_timezone_get(),
    ]);
  }
  return '';
}