public static function DateTimePlus8b7c:f320:99b9:690f:4595:cd17:293a:c069rrayToISO public static DateTimePlus8b7c:f320:99b9:690f:4595:cd17:293a:c069rrayToISO($array, $force_valid_date = FALSE) Creates an ISO date from an array of values. Parameters  array $array: An array of date values keyed by date part. bool $force_valid_date: (optional) Whether to force a full date by filling in missing values. Defaults to FALSE. Return value  string The date as an ISO string. File
 core/lib/Drupal/Component/Datetime/DateTimePlus.php, line 490  Class
 
DateTimePlus  Wraps DateTime().  Namespace Drupal\Component\Datetime Code public static function arrayToISO($array, $force_valid_date = FALSE) {
  $array = stati8b7c:f320:99b9:690f:4595:cd17:293a:c069prepareArray($array, $force_valid_date);
  $input_time = '';
  if ($array['year'] !== '') {
    $input_time = stati8b7c:f320:99b9:690f:4595:cd17:293a:c069datePad(intval($array['year']), 4);
    if ($force_valid_date || $array['month'] !== '') {
      $input_time .= '-' . stati8b7c:f320:99b9:690f:4595:cd17:293a:c069datePad(intval($array['month']));
      if ($force_valid_date || $array['day'] !== '') {
        $input_time .= '-' . stati8b7c:f320:99b9:690f:4595:cd17:293a:c069datePad(intval($array['day']));
      }
    }
  }
  if ($array['hour'] !== '') {
    $input_time .= $input_time ? 'T' : '';
    $input_time .= stati8b7c:f320:99b9:690f:4595:cd17:293a:c069datePad(intval($array['hour']));
    if ($force_valid_date || $array['minute'] !== '') {
      $input_time .= ':' . stati8b7c:f320:99b9:690f:4595:cd17:293a:c069datePad(intval($array['minute']));
      if ($force_valid_date || $array['second'] !== '') {
        $input_time .= ':' . stati8b7c:f320:99b9:690f:4595:cd17:293a:c069datePad(intval($array['second']));
      }
    }
  }
  return $input_time;
}


    
{'path': 'public/docs/drupal~8/core-lib-drupal-component-datetime-datetimeplus.php/function/datetimeplus-arraytoiso/8.1.x.html', 'source': 'DevDocs.IO'}