# xarray.core.accessor_dt.DatetimeAccessor.strftime

#### DatetimeAccessor.strftime(date_format)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/accessor_dt.py#L356-L387)

Return an array of formatted strings specified by date_format, which
supports the same string format as the python standard library. Details
of the string format can be found in [python string format doc](https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior)

* **Parameters:**
  **date_format** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – date format string (e.g. “%Y-%m-%d”)
* **Returns:**
  **formatted strings** (`same type as values`) – Array-like of strings formatted for each element in values

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('f58a35f1-2e5a-45d7-9f11-df717f7970c9','9a1c6ab0-aca2-40be-83ad-594903e5bab9','5d310d65-e472-4334-b450-7b7e23ea1c06','../lite/tree/../notebooks/index.html?path=e87cc280_aaa6_441f_8f2d_9d683e843fba.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> import datetime
>>> rng = xr.Dataset({"time": datetime.datetime(2000, 1, 1)})
>>> rng["time"].dt.strftime("%B %d, %Y, %r")
<xarray.DataArray 'strftime' ()> Size: 8B
array('January 01, 2000, 12:00:00 AM', dtype=object)
```

<div id="5d310d65-e472-4334-b450-7b7e23ea1c06" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('f58a35f1-2e5a-45d7-9f11-df717f7970c9','5d310d65-e472-4334-b450-7b7e23ea1c06')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('f58a35f1-2e5a-45d7-9f11-df717f7970c9','5d310d65-e472-4334-b450-7b7e23ea1c06')">Open In Tab</button></div><div id="9a1c6ab0-aca2-40be-83ad-594903e5bab9" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
