public function setDateFromDateTime(DateTime $date = NULL, DateTimeZone $dateTimeZone = NULL) {
    $dateTimeZone = !empty($dateTimeZone) ? $dateTimeZone : new DateTimeZone('UTC');
    $this->date = !empty($date) ? $date : new DateTime($date);
    $this->date->setTimezone($dateTimeZone);
  }
public function setDateFromDateTime(DateTime $date = NULL, DateTimeZone $dateTimeZone = NULL) {
    $dateTimeZone = !empty($dateTimeZone) ? $dateTimeZone : new DateTimeZone('UTC');
    $this->date = !empty($date) ? $date : new DateTime($date);
    $this->date->setTimezone($dateTimeZone);
  }
public function setDateFromDateTime ( DateTime $ date = NULL , DateTimeZone $ dateTimeZone = NULL ) { $ dateTimeZone = ! empty ( $ dateTimeZone ) ? $ dateTimeZone : new DateTimeZone ( 'UTC' ) ; $ this -> date = ! empty ( $ date ) ? $ date : new DateTime ( $ date ) ; $ this -> date -> setTimezone ( $ dateTimeZone ) ; }
Sets the date from a datetime object.

@param \DateTime|null $date
@param \DateTimeZone|null $dateTimeZone
Sets the date from a datetime object .