Is there a possibility to check if DateTime()
can parse a string? When I try for example:
new DateTime('05.06.17');
DateTime cant parse it and will throw a Exception. So, how can I prevent this and check before if the parsing is possible? There is a lot of possible formats DateTime can read and I don't want to check each of them with regex...