Recommend this page to a friend! |
Validation of format is right for given datetime,date or time string variable.
Acronym: [Date-Validator].
Name: Date-Validator.
Dependencies: Stand Alone / PHP v7.4.
is a very simple PHP [Date-Validator] implementation that allows you to easily validate if the PHP variable passed is a string with valid datetime, date, time format.
Developers need the ability to validate if variable meaning a datetime, date or time have a right format, this helps to validate some format dependencies that must have a datetime, date or time string.
if you want to collaborate with the development of the library; You can express your ideas or report any situation related to this in: https://github.com/arcanisgk/Date-Validator/issues
None necessary.
composer require arcanisgk/date-validator
use IcarosNet\DateValidator\DateValidator;
require __DIR__.'\..\vendor\autoload.php';
$date_validator = new DateValidator();
if ($date_validator->ValidateDate('10/10/1999 20:40')) {
echo 'Correct date string';
}
if ($date_validator->ValidateDate('XXX10/10/1999 20:40')) {
echo 'incorrect date string';
}
if($date_validator->addFormat('d--m--Y H%i')->ValidateDate('09--09--2010 20%40')){
echo 'Correct new date format string using % separator';
}
Classes of Francisco Núñez | > | How Can PHP Validate Date According to Valid Date Formats using Date Validator | > | Download .zip .tar.gz | > | Support forum | > | Blog (1) | > | Latest changes |
|
Groups | Applications | Files |
Groups |
Time and Date | Time and date values, formats and conversion | View top rated classes |
Validation | Validation algorithms | View top rated classes |
PHP 7 | Classes using PHP 7 specific features | View top rated classes |
Innovation Award |
November 2022 Nominee Vote |
Many applications take input parameters from users or other external data sources, including dates or times. When the applications allow multiple formats for the date and time values they accept as parameters, they must check them against all the acceptable date and time formats. This package can perform date and time validation that accepts many possible formats and can even support more custom date and time formats. Manuel Lemos |
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Files |
File | Role | Description | ||
---|---|---|---|---|
example (1 file) | ||||
src (1 file) | ||||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation |
Download all files: date-validator.tar.gz date-validator.zip NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
|
Files |
File | Role | Description | ||
---|---|---|---|---|
example (1 file) | ||||
src (1 file) | ||||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation |
Download all files: date-validator.tar.gz date-validator.zip NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
|