I am using LAMP in Kubuntu 14.04 with PHP 5.6.23.
When using DateTime in the following cases:
1.
print_r((new DateTime('2016-02-31'))->format('M/d/Y'));
// Mar/02/2016 (no errors, why?)
2.
print_r((new DateTime('2016-02-32'))->format('M/d/Y'));
// Error - DateTime::__construct(): Failed to parse time string-
// (2016-02-32) at position 9 (2): Unexpected character
Why does the first case not give me any error, since the 31st date of the month of February is missing?
Links Supported Response Requested
source
share