php - Message: DateTime::__construct(): Failed to parse time string (21/12/2020) at position 0 (2): Unexpected character
Get the solution ↓↓↓$start = new DateTime(21/12/2020);
while executing this statement, it gives following error: Type: Exception
Message: DateTime::__construct(): Failed to parse time string (21/12/2020) at position 0 (2): Unexpected character
What could be the reason for this error and what is the solution for it?
Answer
Solution:
Try to replace slashes with dots or slash slashed (like 21\/12\/2020). Better don't use slashes in that context.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: an exception occurred in the driver: could not find driver
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.