# Get rid of 'T' in datetime format display in DataTable

**URL:** <https://community.plotly.com/t/get-rid-of-t-in-datetime-format-display-in-datatable/85329>\
**Category:** Dash Python\
**Created:** [June 21, 2024, 10:51pm UTC](https://community.plotly.com/t/get-rid-of-t-in-datetime-format-display-in-datatable/85329 "2024-06-21T22:51:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![matsuobasho](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@matsuobasho](https://community.plotly.com/u/matsuobasho)\
**Post date:** [June 21, 2024, 10:51pm UTC](https://community.plotly.com/t/get-rid-of-t-in-datetime-format-display-in-datatable/85329/1 "2024-06-21T22:51:32Z")

</div>

I’m outputting a dataframe to the layout in my app using `dash_table.DataTable`.

The relevant column displays as:  
2021-01-01T02:00:00

I want to replace the ‘T’ with a space - I think the T is confusing for a non-technical user.

I tried this argument in my DataTable definition but it didn’t do anything:

```auto
columns=[{'name': 'Timestamp', 'id': 'ds', 'type': 'datetime', 'format': dict(specifier='%Y-%m-%d %H:%M:%S')}
                   ],

```

What is the most elegant solution here?

---

<div class="post-metadata">

**Author:** ![mo.elauzei](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/mo.elauzei/32/22101_2.png) [@mo.elauzei](https://community.plotly.com/u/mo.elauzei)\
**Post date:** [June 22, 2024, 12:31am UTC](https://community.plotly.com/t/get-rid-of-t-in-datetime-format-display-in-datatable/85329/2 "2024-06-22T00:31:33Z")

</div>

Hi @matsuobasho

Why don’t you make the change in the dataframe itself? you can do something like this:

`df['datetime'] = pd.to_datetime(df['datetime'].str.replace('T', ' '))`

---

<div class="post-metadata">

**Author:** ![matsuobasho](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@matsuobasho](https://community.plotly.com/u/matsuobasho)\
**Post date:** [June 22, 2024, 2:55am UTC](https://community.plotly.com/t/get-rid-of-t-in-datetime-format-display-in-datatable/85329/3 "2024-06-22T02:55:39Z")

</div>

Because this ‘T’ is a `dash.DataTable` display feature. It is not part of pandas the datetime datatype. The datetime type output in Pandas looks normal, without the ‘T’

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [June 22, 2024, 2:13pm UTC](https://community.plotly.com/t/get-rid-of-t-in-datetime-format-display-in-datatable/85329/4 "2024-06-22T14:13:02Z")

</div>

Hello @matsuobasho,

I don’t know if this is possible with DataTable.

But it definitely available with AG Grid. You can pass a custom `valueFormatter` which can display the data in any way that you want.

> **[Dash AG Grid | Dash for Python Documentation | Plotly](https://dash.plotly.com/dash-ag-grid)**
>
> How to install Dash AG Grid, a high-performance and highly customizable component based on AG Grid.
