diff --git a/stackstac/prepare.py b/stackstac/prepare.py index 2538aee..e2273e7 100644 --- a/stackstac/prepare.py +++ b/stackstac/prepare.py @@ -350,7 +350,7 @@ def to_coords( [item["properties"]["datetime"] for item in items], infer_datetime_format=True, errors="coerce", - ), + ).tz_convert('UTC').tz_localize(None), "id": xr.Variable("time", [item["id"] for item in items]), "band": asset_ids, } diff --git a/stackstac/stack.py b/stackstac/stack.py index 53cfc4c..794b33b 100644 --- a/stackstac/stack.py +++ b/stackstac/stack.py @@ -253,8 +253,9 @@ def stack( xarray DataArray, backed by a Dask array. No IO will happen until calling ``.compute()``, or accessing ``.values``. The dimensions will be ``("time", "band", "y", "x")``. - ``time`` will be equal in length to the number of items you pass in, and indexed by date. Note that this means - multiple entries could have the same index. + ``time`` will be equal in length to the number of items you pass in, and indexed by STAC Item datetime. + Note that this means multiple entries could have the same index. Note also datetime strings are cast to + 'UTC' but passed to xarray without timezone information (dtype='datetime64[ns]'). ``band`` will be equal in length to the number of asset IDs used (see the ``assets`` parameter for more).