src/Filter/Sanitizers.php
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));
    }
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));
    }
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 ) ) ; }
check for valid date-time input string.

@param ValueTO $v
@param bool|string $p
check for valid date - time input string .