original_string: public function filter_datetime($v, $p)
      {
          if (is_bool($p) && $p) {
              $p = 'Y-m-d H:i:s';
          }
          $dt = \date_create_from_format($p, $v->getValue());
          if (!$dt) {
              $v->setValue(null);
              $v->setError(__METHOD__, $p);
              return;
          }
          $v->setValue($dt->format($p));
      }
code: public function filter_datetime($v, $p)
      {
          if (is_bool($p) && $p) {
              $p = 'Y-m-d H:i:s';
          }
          $dt = \date_create_from_format($p, $v->getValue());
          if (!$dt) {
              $v->setValue(null);
              $v->setError(__METHOD__, $p);
              return;
          }
          $v->setValue($dt->format($p));
      }
code_tokens: public function filter_datetime ( $ v , $ p ) { if ( is_bool ( $ p ) && $ p ) { $ p = 'Y-m-d H:i:s' ; } $ dt = \ date_create_from_format ( $ p , $ v -> getValue ( ) ) ; if ( ! $ dt ) { $ v -> setValue ( null ) ; $ v -> setError ( __METHOD__ , $ p ) ; return ; } $ v -> setValue ( $ dt -> format ( $ p ) ) ; }
docstring: check for valid date-time input string.
  
  @param ValueTO $v
  @param bool|string $p
docstring_tokens: check for valid date - time input string .