HOW TO validate datetime fields?

Discuss everything related to DataValidator. All versions. Any questions related to the DataValidator developing or using should be posted to this forum.

Moderators: alexandrleonenko, goas

Site Admin
Site Admin
Posts: 6195
Joined: Jan 7th, '09, 23:18

HOW TO validate datetime fields?

Postby administrator » Apr 9th, '13, 05:59

The solution to validate it as a string with your own regular expression.
(special thanks to Stacey Koster)

Below the example.
$regex = '/^\d{1,2}\/\d{1,2}\/\d{4}$/';
$validreadDate = new ValidatorTypeString("read_date", ValidatorTypeString::$subtypeAlphanumeric,'read date');

Return to “ApPHP DataValidator”