if you try and convert a date higher than 10000 with DateTime natively the following occurs
$date = new DateTime("9999-12-31");
var_dump($date->format('Y-m-d'));
$date_2 = new DateTime("10000-01-01");
var_dump($date_2->format('Y-m-d'));
RESULT:
string(10) "9999-12-31"
string(10) "2000-01-01"
Notice that values higher than the year 10,000 present unexpected results.
However, if you are using a 64-bit version of PHP you can look for dates ~293billion years in either direction, see https://php.net/strtotime
The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 UTC to Tue, 19 Jan 2038 03:14:07 UTC. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer.)
Prior to PHP 5.1.0, not all platforms support negative timestamps, therefore your date range may be limited to no earlier than the Unix epoch. This means that e.g. dates prior to Jan 1, 1970 will not work on Windows, some Linux distributions, and a few other operating systems.
For 64-bit versions of PHP, the valid range of a timestamp is effectively infinite, as 64 bits can represent approximately 293 billion years in either direction.
You could probably create a custom validation rule, which validates the date against the number of seconds (assuming 64 bit PHP)
UPDATE: Looked at the documentation for validation and found
before:date
The field under validation must be a value preceding the given date. The dates will be passed into the PHP strtotime function. In addition, like the after rule, the name of another field under validation may be supplied as the value of date.
Interestingly, strtotime("10000-01-01 00:00:00") returns false, whilst strtotime("9999-12-31 23:59:59") returns an integer. the validation rule cannot parse the date.
date_format:Y-m-d|before:today? - Dilip Hiraparadateworking for you? i am using date type input field and the application will be used from different countries. i am not sure which format is user viewing the date. - nasirkhan