BUG: to_csv output formatting for datetimes
closes #29711 

…ssue and provides rounding variable to csv formatter to handle datetimes differently. I decided to try and tackle this issue for one of the classes I am in at university. The issue seems to be stemming from the fact that BlockManager is grouping together two differently formatted datetime values in the DataFrame thus making it so the second datetime value is formatted like the first(leading to the trailing zeroes in the example). If you want to format all datetimes the same in the csv you can simply make use of the date_format attribute which the CsvFormatter takes as a variable to format the datetimes however you like. I decided to add a rounding_milliseconds attribute to the csv formatter which would remove  the milliseconds from the end of the datetime if they are all equal to '0'. 

- [x] tests added / passed
- [x] passes `black pandas`

Hello @burkbre! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:







* In the file [`pandas/tests/frame/test_to_csv.py`](https://github.com/pandas-dev/pandas/blob/0b8091ca51ab487867eb2ab30d7512ef8819a5eb/pandas/tests/frame/test_to_csv.py):

> [Line 1365:79](https://github.com/pandas-dev/pandas/blob/0b8091ca51ab487867eb2ab30d7512ef8819a5eb/pandas/tests/frame/test_to_csv.py#L1365): [E231](https://duckduckgo.com/?q=pep8%20E231) missing whitespace after ','
> [Line 1370:89](https://github.com/pandas-dev/pandas/blob/0b8091ca51ab487867eb2ab30d7512ef8819a5eb/pandas/tests/frame/test_to_csv.py#L1370): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (89 > 88 characters)
> [Line 1388:79](https://github.com/pandas-dev/pandas/blob/0b8091ca51ab487867eb2ab30d7512ef8819a5eb/pandas/tests/frame/test_to_csv.py#L1388): [E231](https://duckduckgo.com/?q=pep8%20E231) missing whitespace after ','
> [Line 1399:89](https://github.com/pandas-dev/pandas/blob/0b8091ca51ab487867eb2ab30d7512ef8819a5eb/pandas/tests/frame/test_to_csv.py#L1399): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (89 > 88 characters)
> [Line 1405:79](https://github.com/pandas-dev/pandas/blob/0b8091ca51ab487867eb2ab30d7512ef8819a5eb/pandas/tests/frame/test_to_csv.py#L1405): [E231](https://duckduckgo.com/?q=pep8%20E231) missing whitespace after ','
> [Line 1416:89](https://github.com/pandas-dev/pandas/blob/0b8091ca51ab487867eb2ab30d7512ef8819a5eb/pandas/tests/frame/test_to_csv.py#L1416): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (89 > 88 characters)



##### Comment last updated at 2019-12-10 20:42:15 UTC pls search the issue queue, IIRC there are a number of issues about this @burkbre is this still active? As mentioned don't want to add new keywords so would need an alternate approach like the dict argument for `date_format` Thanks @burkbre for the PR but I think has gone stale. I think also needs a different approach but ping if you'd like to continue and can address comments