joomla/joomla-platform — pull request #705 by bembelimen (2012-01-04 02:07:48+00:00)
Title: JDate breaks valid DateTime input

JDate assumes that every number is an unix timestamp, but according to the PHP documentation (see http://www.php.net/manual/en/datetime.formats.date.php) it is possible to use an 8 digit number as valid parameter which is not a timestamp (see ISO8601 Notations). This number consists the year, the month and the day without any separators (e.g. 20120101 for 2012/01/01). It's also valid to use only the year (four digits) as parameter.

So the first step is, that Joomla! should only handle numbers with more than 8 digits as unix timestamp.
The second step should be the removing of the whole test, because DateTime can handle unix timestamps by itself, if the programmer prepend an "@" char to the number (see http://www.php.net/manual/en/datetime.formats.compound.php "Localized Notations"). But this needs further testing, if there are any conflicts in the Joomla! environment. So this requests fixs only the "8 digit problem" and mark the test itself as deprecated.