Return None when datetime is not valid.