original_string: public function localizedTime($field, $type = 'datetime', $message = null, $when = null)
      {
          $extra = array_filter(['on' => $when, 'message' => $message]);
  
          return $this->add($field, 'localizedTime', $extra + [
              'rule' => ['localizedTime', $type]
          ]);
      }
code: public function localizedTime($field, $type = 'datetime', $message = null, $when = null)
      {
          $extra = array_filter(['on' => $when, 'message' => $message]);
  
          return $this->add($field, 'localizedTime', $extra + [
              'rule' => ['localizedTime', $type]
          ]);
      }
code_tokens: public function localizedTime ( $ field , $ type = 'datetime' , $ message = null , $ when = null ) { $ extra = array_filter ( [ 'on' => $ when , 'message' => $ message ] ) ; return $ this -> add ( $ field , 'localizedTime' , $ extra + [ 'rule' => [ 'localizedTime' , $ type ] ] ) ; }
docstring: Add a localized time, date or datetime format validation rule to a field.
  
  @param string $field The field you want to apply the rule to.
  @param string $type Parser type, one out of 'date', 'time', and 'datetime'
  @param string|null $message The error message when the rule fails.
  @param string|callable|null $when Either 'create' or 'update' or a callable that returns
  true when the validation rule should be applied.
  @see \Cake\Validation\Validation::localizedTime()
  @return $this
docstring_tokens: Add a localized time date or datetime format validation rule to a field .