You are here

public function GetServices::validateDate in Simple Node Importer 8

File

src/Services/GetServices.php, line 1271

Class

GetServices

Namespace

Drupal\simple_node_importer\Services

Code

public function validateDate($date, $format = 'Y-m-d H:i:s') {
  if ($this
    ->validateDateExpression($date)) {
    $d = DrupalDateTime::createFromFormat($format, $date);
    return $d && $d
      ->format($format) == $date;
  }
  else {
    return FALSE;
  }
}