1.2.600. Invalid Date Scanning Format¶
The format string used with Datetime::createFromFormat() method (or similar) contains unknown characters.
This won’t raise an error, though the resulting values should be checked.
<?php
// format is valid
$date = datetimeimmutable::createFromFormat('d/m/Y', $a);
// When wrong, $date is false
// The errors are in datetimeimmutable::getLastErrors();
// X is not a valid character for
$date = datetimeimmutable::createFromFormat('d/X/Y', $a);
?>
1.2.600.1. Connex PHP features¶
1.2.600.1.1. Suggestions¶
Remove the unknown characters
Replace the unknown character with the expected one
1.2.600.1.2. Specs¶
Short name |
Structures/InvalidDateScanningFormat |
Rulesets |
|
Exakat since |
2.4.5 |
PHP Version |
All |
Severity |
Major |
Time To Fix |
Quick (30 mins) |
Precision |
High |
Available in |