Added validity to datetime parser.
Trying to make code Python3 complient