code: public function mapToFrom($value)
      {
          if ($value instanceof \DateTime) {
  
              // ensure the timezone
              $date = (new \DateTime('now', $this->timeZone))->setTimestamp($value->getTimestamp());
  
              return $date->format($this->format);
          }
  
          return '';
      }
docs: @param \DateTime $value
  
  @return mixed