BUG: Fix parsing of stata dates (#17797)
State: closed

- [x] closes #17797 
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] Test and expand parsing of STATA date/time objects.

Expands behavior provided by the following to include most STATA format codes.
```python
        # remove format details from %td
        self.fmtlist = ["%td" if x.startswith("%td") else x
                        for x in self.fmtlist]
```

Add tests for above behavior (previously untested) + all additional format codes

Labels:
name: Bug
name: IO Stata
description: read_stata, to_stata

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17990?src=pr&el=h1) Report
> Merging [#17990](https://codecov.io/gh/pandas-dev/pandas/pull/17990?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/6779ac0efb166052deced47f23e18196808439ed?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #17990      +/-   ##
==========================================
- Coverage   91.23%   91.22%   -0.02%     
==========================================
  Files         163      163              
  Lines       50113    50112       -1     
==========================================
- Hits        45723    45713      -10     
- Misses       4390     4399       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.03% <100%> (-0.01%)` | :arrow_down: |
| #single | `40.31% <0%> (-0.06%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17990?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/stata.py](https://codecov.io/gh/pandas-dev/pandas/pull/17990?src=pr&el=tree#diff-cGFuZGFzL2lvL3N0YXRhLnB5) | `93.7% <100%> (-0.01%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/17990?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/17990?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.75% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17990?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/17990?src=pr&el=footer). Last update [6779ac0...9ab0681](https://codecov.io/gh/pandas-dev/pandas/pull/17990?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17990?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@cc7abd9`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff            @@
##             master   #17990   +/-   ##
=========================================
  Coverage          ?   91.25%           
=========================================
  Files             ?      163           
  Lines             ?    50099           
  Branches          ?        0           
=========================================
  Hits              ?    45716           
  Misses            ?     4383           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.06% <100%> (?)` | |
| #single | `40.24% <0%> (?)` | |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17990?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/stata.py](https://codecov.io/gh/pandas-dev/pandas/pull/17990?src=pr&el=tree#diff-cGFuZGFzL2lvL3N0YXRhLnB5) | `93.7% <100%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17990?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/17990?src=pr&el=footer). Last update [cc7abd9...04ec86f](https://codecov.io/gh/pandas-dev/pandas/pull/17990?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

@miker985 : You're going to need to add a `whatsnew` for this PR.  However, as the doc for `0.21.1` is not available yet, just hold tight.  Feel free to ping us later if we forget to let you know.
@gfyoung Is this the comment you're looking for?

I'll wait to hear back on the `whatsnew` file. If I don't hear back in e.g., a week should I ping you?
> If I don't hear back in e.g., a week should I ping you?

@TomAugspurger should be merging the PR for the `whatsnew` soon, so that works.
can you add a whatsnew for 0.21.1 (bug fix io section)
thanks @miker985