html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/2587#issuecomment-727710036,https://api.github.com/repos/pydata/xarray/issues/2587,727710036,MDEyOklzc3VlQ29tbWVudDcyNzcxMDAzNg==,26384082,2020-11-16T03:15:42Z,2020-11-16T03:15:42Z,NONE,"In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity
If this issue remains relevant, please comment here or remove the `stale` label; otherwise it will be marked as closed automatically
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,386596872
https://github.com/pydata/xarray/issues/2587#issuecomment-444071471,https://api.github.com/repos/pydata/xarray/issues/2587,444071471,MDEyOklzc3VlQ29tbWVudDQ0NDA3MTQ3MQ==,13662783,2018-12-04T11:42:47Z,2018-12-04T11:42:58Z,CONTRIBUTOR,"Thanks, I'll indeed use `cftime.datetime` objects directly.
`cftime.DatetimeProlepticGregorian` seems the obvious default to me as well.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,386596872
https://github.com/pydata/xarray/issues/2587#issuecomment-443543672,https://api.github.com/repos/pydata/xarray/issues/2587,443543672,MDEyOklzc3VlQ29tbWVudDQ0MzU0MzY3Mg==,6628425,2018-12-02T21:26:50Z,2018-12-02T21:26:50Z,MEMBER,"Thanks for the clear report @Huite. Indeed we did not consider this particular use case when updating the behavior in version 0.11 (i.e. non-cftime dates passed to the DataArray constructor that are outside the [`np.datetime64[ns]` range](https://docs.scipy.org/doc/numpy/reference/arrays.datetime.html#datetime-units)).
As you noted, in this situation it would probably make sense to coerce these dates to a `cftime` date type; specifically, I think the correct type to use would be `cftime.DatetimeProlepticGregorian`, because the [Python documentation states](https://docs.python.org/3/library/datetime.html#available-types) that `datetime.date` (and by extension `datetime.datetime`) objects assume ""the current Gregorian calendar always was, and always will be, in effect.""
Note if you use `cftime.datetime` objects directly things work as you might expect:
```
In [1]: import cftime; import xarray
In [2]: times = [cftime.DatetimeProlepticGregorian(1000, 1, 1)]
In [3]: da = xarray.DataArray(times, dims=['time'], coords=[times])
In [4]: da
Out[4]:
array([cftime.DatetimeProlepticGregorian(1000, 1, 1, 0, 0, 0, 0, 0, 1)], dtype=object)
Coordinates:
* time (time) object 1000-01-01 00:00:00
```
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,386596872