We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DateRule validates a string value that represents a date. DateTimeRule validates a string value that represents date and time.
DateRule
DateTimeRule
format, see DateTime::createFromFormat()
format
For Date default could be 'Y-m-d', for DateTime it could be Y-m-d H:i:s.
Date
DateTime
Y-m-d H:i:s
Use \DateTime::createFromFormat() then \DateTime::getLastErrors() or regex + validating if date and time are valid.
\DateTime::createFromFormat()
\DateTime::getLastErrors()
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
I wrote a similar one for my needs (need to fix namespaces). It may be useful with a little tweaking DateTime.zip
Fix #602: Add DateTime rule
e71f972
Successfully merging a pull request may close this issue.
DateRule
validates a string value that represents a date.DateTimeRule
validates a string value that represents date and time.Options
format
, see DateTime::createFromFormat()For
Date
default could be 'Y-m-d', forDateTime
it could beY-m-d H:i:s
.Implementation
Use
\DateTime::createFromFormat()
then\DateTime::getLastErrors()
or regex + validating if date and time are valid.The text was updated successfully, but these errors were encountered: