ENH: support zoneinfo tzinfos
- [x] closes #37654 (Replace xxxx with the Github issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

The tzlocal-handling code is effectively using the tzinfo/datetime API "correctly", so this adapts zoneinfo cases to go through that path.

We may be able to eek out some extra perf by combining tzlocal/zoneinfo checks or something.  Just did the simplest thing here.

cc @pganssle note the comment about the cache in timezones.pyx L55.  Is this dangerous and if so can you suggest an alternative?

Potentially closes #43516, haven't checked.
looks like one of the code checks doesn't like "backports.zoneinfo" in the deps file.  guessing its the "." causing trouble > cc @pganssle note the comment about the cache in timezones.pyx L55. Is this dangerous and if so can you suggest an alternative?

It's certainly "dangerous" in the sense that your UTC-detection logic will fail even for UTC-like zones. I think the whole endeavor is a bit foolhardy, as there is no reliable, guaranteed interface for determining whether a given zone is UTC. Your heuristics will work in a great many cases, so "user cleared the cache and people are using `ZoneInfo("UTC")`" is just another one of those.

That said, `str(some_zoneinfo_zone)` returns the `key` parameter if it exists, so you could presumably detect this with `isinstance(zone, ZoneInfo) and str(zone) == "UTC"`. is the pre-commit failure real or a false-positive? > is the pre-commit failure real or a false-positive?

I think it's a false positive as pre-commit.ci is being set up.

Looks pretty good; just needs a whatsnew entry.

Also these tests are running okay on the CI on all platforms? I see from the zoneinfo docs that tzdata might need to be installed if a platform doesn't have system tz data: https://docs.python.org/3/library/zoneinfo.html#data-sources > Also these tests are running okay on the CI on all platforms?

Looks OK.  I dont know how common the no-tzdata case is.  i think we're OK punting on that and can revisit if/when someone opens an issue about it > Looks OK. I dont know how common the no-tzdata case is. i think we're OK punting on that and can revisit if/when someone opens an issue about it

It was more of a question if our `ci/deps/` files need to install `tzdata` to be sure these tests are being run, but it sounds like they are.

IMO users should be responsible for installing tzdata if they need for personal use cases.  Thanks LGTM.

Yeah a follow up calling this out as an enhancement that all Timstamp/DTI/etc can all accept ZoneInfo objects now would be good.
