original_string: public function transform($dateTime)
      {
          if ($dateTime === null || trim($dateTime) == '') {
              return '';
          }
  
          if (!$dateTime instanceof \DateTime) {
              throw new TransformationFailedException('Expected a \DateTime.');
          }
  
          $dateTime = clone $dateTime;
          if ($this->inputTimezone !== $this->outputTimezone) {
              try {
                  $dateTime->setTimezone(new \DateTimeZone($this->outputTimezone));
              } catch (\Exception $e) {
                  throw new TransformationFailedException($e->getMessage(), $e->getCode(), $e);
              }
          }
  
          // This is passed to the concrete5 DateTime widget, so the format
          // can be anything that can be parsed with the default PHP datetime
          // functions.
          return $dateTime->format('Y-m-d H:i:s');
      }
code: public function transform($dateTime)
      {
          if ($dateTime === null || trim($dateTime) == '') {
              return '';
          }
  
          if (!$dateTime instanceof \DateTime) {
              throw new TransformationFailedException('Expected a \DateTime.');
          }
  
          $dateTime = clone $dateTime;
          if ($this->inputTimezone !== $this->outputTimezone) {
              try {
                  $dateTime->setTimezone(new \DateTimeZone($this->outputTimezone));
              } catch (\Exception $e) {
                  throw new TransformationFailedException($e->getMessage(), $e->getCode(), $e);
              }
          }
  
          // This is passed to the concrete5 DateTime widget, so the format
          // can be anything that can be parsed with the default PHP datetime
          // functions.
          return $dateTime->format('Y-m-d H:i:s');
      }
code_tokens: public function transform ( $ dateTime ) { if ( $ dateTime === null || trim ( $ dateTime ) == '' ) { return '' ; } if ( ! $ dateTime instanceof \ DateTime ) { throw new TransformationFailedException ( 'Expected a \DateTime.' ) ; } $ dateTime = clone $ dateTime ; if ( $ this -> inputTimezone !== $ this -> outputTimezone ) { try { $ dateTime -> setTimezone ( new \ DateTimeZone ( $ this -> outputTimezone ) ) ; } catch ( \ Exception $ e ) { throw new TransformationFailedException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } } // This is passed to the concrete5 DateTime widget, so the format // can be anything that can be parsed with the default PHP datetime // functions. return $ dateTime -> format ( 'Y-m-d H:i:s' ) ; }
docstring: Transforms a normalized date into a the concrete5 datetime widget format.
  
  @param \DateTime $dateTime Normalized date.
  
  @return string Widget format date.
  
  @throws TransformationFailedException If the given value is not an
  instance of \DateTime or if the
  output timezone is not supported.
docstring_tokens: Transforms a normalized date into a the concrete5 datetime widget format .