PHP 4.0 Bug #6399: checkdate should be able to validate a time as well as a date (timestamp)

From: Date: Mon, 28 Aug 2000 12:45:25 +0000
Subject: PHP 4.0 Bug #6399: checkdate should be able to validate a time as well as a date (timestamp)
Groups: php.dev 
Request: Send a blank email to php-dev+get-30955@lists.php.net to get a copy of this message
From: juhl@eisenstein.dk Operating system: * PHP version: 4.0 Latest CVS (28/08/2000) PHP Bug Type: Feature/Change Request Bug description: checkdate should be able to validate a time as well as a date (timestamp) It would be nice if checkdate could validate a time as well as a date. Currently you can only check that a given month/day/year combination is valid. if this could be extended to validate month/day/year/hour/minute/second (possibly taking leap-seconds into acount) it would make it much easier to validate dates and times that a user enters before doing anything (like storing it in a db) with it, as everything could be checked with a single call. And it would be nice if you could just pass NULL or something similar to ignore one or more fields, so that the following examples would all be valid: checkdate(3, 15, 2000, NULL, NULL, NULL); // only validate date checkdate(NULL, NULL, NULL, 16, 05, 31); // only validate time checkdate(3, 15, 2000, 16, 05, 31); // validate date and time checkdate(NULL, 15, NULL, 16, NULL, NULL); // validate partial date and partial time Best regards, Jesper Juhl juhl@eisenstein.dk

« previous php.dev (#30955) next »