Some validation to create a datetime object