Add test for GH 18523 and add _tz_compare() to compare timezone of DatetimeIndex
- [x] closes #18523 
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

Add a new private function `_tz_compare` which compares timezones of DatetimeIndex.

@jreback 
