# Get datepart from @timestamp in 7.1

**URL:** <https://discuss.elastic.co/t/get-datepart-from-timestamp-in-7-1/255752>\
**Category:** Kibana\
**Created:** [November 17, 2020, 6:57pm UTC](https://discuss.elastic.co/t/get-datepart-from-timestamp-in-7-1/255752 "2020-11-17T18:57:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![himanshur](https://avatars.discourse-cdn.com/v4/letter/h/b9e5f3/32.png) [@himanshur](https://discuss.elastic.co/u/himanshur)\
**Post date:** [November 17, 2020, 6:57pm UTC](https://discuss.elastic.co/t/get-datepart-from-timestamp-in-7-1/255752/1 "2020-11-17T18:57:45Z")

</div>

I am trying to get the date part from the @timestamp field in 7.1. Looks like all the date functions were introduced in 7.5.  
Is there a way I can get the date part using SQL in Kibana

Trying the below query  
`SELECT date_part('day',"@timestamp") as date FROM <index_name> `

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [November 19, 2020, 7:09pm UTC](https://discuss.elastic.co/t/get-datepart-from-timestamp-in-7-1/255752/2 "2020-11-19T19:09:23Z")

</div>

You must be using canvas? Do you need all the day parts to be unique? You could post-process the dates by formatting them, something like this

```auto
|essql "SELECT \"@timestamp\" as date FROM index"
| mapColumn date fn={getCell | date format="MM/DD"}

```

> **[Canvas function reference | Kibana Guide \[7.10\] | Elastic](https://www.elastic.co/guide/en/kibana/current/canvas-function-reference.html#date_fn)**

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 17, 2020, 7:09pm UTC](https://discuss.elastic.co/t/get-datepart-from-timestamp-in-7-1/255752/3 "2020-12-17T19:09:44Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
