# xarray.DataArray.dt.strftime

#### DataArray.dt.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('dd616142-c987-45f2-ac89-684d67017ec4','3f20366b-11ae-41d1-8735-b90041de46b1','2dc56b45-9e6a-4812-b5d7-d2daa303b380','../lite/tree/../notebooks/index.html?path=3cc1cc42_0025_42e9_9eb7_d537f1b6b02d.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="2dc56b45-9e6a-4812-b5d7-d2daa303b380" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('dd616142-c987-45f2-ac89-684d67017ec4','2dc56b45-9e6a-4812-b5d7-d2daa303b380')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('dd616142-c987-45f2-ac89-684d67017ec4','2dc56b45-9e6a-4812-b5d7-d2daa303b380')">Open In Tab</button></div><div id="3f20366b-11ae-41d1-8735-b90041de46b1" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
