PHP 8.5.0 Alpha 1 available for testing

Voting

: zero plus one?
(Example: nine)

The Note You're Voting On

peter dot labos at gmail dot com
1 year ago
If you are not happy with wide range of conversions and repairs this method is making for you, or just want to check that date is really same as input:

```
$datetime = \DateTimeImmutable::createFromFormat('Y-m-d G:i:s', $userDateTimeInput);

if ($datetime && $datetime->format('Y-m-d G:i:s') === $userDateTimeInput) {
// $datetime is not false and we have a correct date in correct format from user
}
```

<< Back to user notes page

To Top