Add timetz attribute to DatetimeIndex
State: closed

- [x] closes #21358 
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

I only added timetz to DatetimeIndex because there was already a timetz method in Timestamp that did essentially the same thing. If it is still worth adding to Timestamp though, I can certainly do that.


Labels:
name: Enhancement
name: Timezones
description: Timezone data dtype

Comments:
Looks good overall!

1) Could you add the `timetz` attribute to this list: http://pandas.pydata.org/pandas-docs/stable/timeseries.html?#time-date-components

2) Could you check if we have some tests for `Timestamp.timetz` and add one if we don't have any?
I didn't add a timetz attribute to Timestamp yet because it inherits a timetz method directly from standard library datetime. So should we add an attribute on top of that? And I assume we don't have any tests right now because it is a standard library thing
I don't think you have to add a `timetz` property to `Timestamp`, but please go ahead and add some `timetz` tests for `Timestamp` if we don't have any so we can make sure the behavior is consistent with `datetime`.  
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22132?src=pr&el=h1) Report
> Merging [#22132](https://codecov.io/gh/pandas-dev/pandas/pull/22132?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/776fed3ab63d74ddef6e5af1a702b10c2a30bbb6?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/22132/graphs/tree.svg?width=650&height=150&src=pr&token=eZ4WkYLtcO)](https://codecov.io/gh/pandas-dev/pandas/pull/22132?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #22132      +/-   ##
==========================================
+ Coverage   92.06%   92.06%   +<.01%     
==========================================
  Files         169      169              
  Lines       50694    50696       +2     
==========================================
+ Hits        46671    46673       +2     
  Misses       4023     4023
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.47% <100%> (ø)` | :arrow_up: |
| #single | `42.32% <66.66%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/22132?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/22132/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lcy5weQ==) | `95.52% <100%> (+0.02%)` | :arrow_up: |
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/22132/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `95.54% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22132?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22132?src=pr&el=footer). Last update [776fed3...6cfa9a1](https://codecov.io/gh/pandas-dev/pandas/pull/22132?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Ok, gotcha
Sorry forgot one more thing; could you add a `timetz` test for with the `dt` accessor (e.g. `Series.dt.timetz`)? They can be found here.

https://github.com/pandas-dev/pandas/blob/master/pandas/tests/series/test_datetime_values.py

After that one test LGTM.
I find an attribute for this is very confusing, as compared to the function call similar to  ``.time()``. would a function call be better here? (of course this would be a break with ``datetime.datetime``)

For the PR, I think we should leave it as a property for now since we break this property vs. method for other `DatetimeIndex` attributes (`date`, `time`, `weekday`), and then in another PR consider converting these to method calls (maybe even before v0.24).

(Although I don't even know why these are method calls for `datetime` in the first place...)
@mroeschke how does it look?
Any other comments @jreback? 
thanks @jquinon nice patch!