# How convert datetime(string) in days

**URL:** https://discuss.elastic.co/t/how-convert-datetime-string-in-days/262876
**Category:** Kibana
**Created:** [February 1, 2021, 5:44pm UTC](https://discuss.elastic.co/t/how-convert-datetime-string-in-days/262876 "2021-02-01T17:44:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ITchandj](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@ITchandj](https://discuss.elastic.co/u/ITchandj)
#### Post date: [February 1, 2021, 5:44pm UTC](https://discuss.elastic.co/t/how-convert-datetime-string-in-days/262876/1 "2021-02-01T17:44:55Z")

</div>

How to convert a Datetime(string) to days(number) in Kibana. Indeed i would like to convert SessionLogonTime into days. thank you for your ideas and solutions if possible.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/4/141f8f8c4caf5ef505abfd5b906ba7f5f22885c0.png)

---

<div class="post-metadata">

### Author: ![Patrick\_Mueller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_mueller/32/109425_2.png) [@Patrick\_Mueller](https://discuss.elastic.co/u/Patrick_Mueller)
#### Post date: [February 4, 2021, 5:54am UTC](https://discuss.elastic.co/t/how-convert-datetime-string-in-days/262876/2 "2021-02-04T05:54:44Z")

</div>

Not sure what you mean by "days". You have a date and a count, what is the formula for calculating the "days" from those values.

In general within Kibana, you can update your index pattern to display some values like dates in different formats. In the left nav, click on "Stack Management" near the bottom. On the next page, click on "Index Patterns" under "Kibana". From there select your index pattern, and you'll see a list of the fields in the index. Click the pencil icon on the right to change the format when displayed in Kibana.

Beyond that, is there a specific view in Kibana where you want to see these? Discover? Dashboards?

---

<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: [March 4, 2021, 5:55am UTC](https://discuss.elastic.co/t/how-convert-datetime-string-in-days/262876/3 "2021-03-04T05:55:25Z")

</div>

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