Fixes Error thrown when None is passed to pd.to_datetime() with format as %Y%m%d
- [ ] closes #30011 
- [x] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry `bug fix of to_datetime for pandas versions >0.24. Now the change will avoid error even when value passed None to to_datetime`
