# 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('ba1a75a8-5f02-4409-8be5-809ed9f8361c','337ef628-2584-4afd-892e-469b34e555aa','b724eb97-c289-4c5c-a2d6-914bc8f5de9b','../lite/tree/../notebooks/index.html?path=f6e56dc5_4b4b_4e0c_95c6_83cbf8966a72.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="b724eb97-c289-4c5c-a2d6-914bc8f5de9b" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('ba1a75a8-5f02-4409-8be5-809ed9f8361c','b724eb97-c289-4c5c-a2d6-914bc8f5de9b')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('ba1a75a8-5f02-4409-8be5-809ed9f8361c','b724eb97-c289-4c5c-a2d6-914bc8f5de9b')">Open In Tab</button></div><div id="337ef628-2584-4afd-892e-469b34e555aa" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
