# DateTime in Human Readable format Kibana

**URL:** https://discuss.elastic.co/t/datetime-in-human-readable-format-kibana/257618
**Category:** Kibana
**Created:** [December 4, 2020, 7:48am UTC](https://discuss.elastic.co/t/datetime-in-human-readable-format-kibana/257618 "2020-12-04T07:48:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![RamyaGowda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ramyagowda/32/27440_2.png) [@RamyaGowda](https://discuss.elastic.co/u/RamyaGowda)
#### Post date: [December 4, 2020, 7:48am UTC](https://discuss.elastic.co/t/datetime-in-human-readable-format-kibana/257618/1 "2020-12-04T07:48:18Z")

</div>

Hi Team,

I was trying to create a metric visualization to show when was the last time server health is checked  
Max(DateTime) really doesnot make more sense to user,so i created the scripted field "LastCheckInHumanReadableFormat" with the following configuration and use this scripted field to create visualization.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/c/ec36108ce44ea54892143c7660dda072fb070b48.png)

This visualization always says " **51Years**" but the expected value should be 10 days i have the data of only Nov 25th

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/8/e8f2b218f2822df8c03aef8acb7a852388976e2b.png)

What's going wrong here?

Thanks in Advance  
Ramya

---

<div class="post-metadata">

### Author: ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)
#### Post date: [December 4, 2020, 8:11am UTC](https://discuss.elastic.co/t/datetime-in-human-readable-format-kibana/257618/2 "2020-12-04T08:11:11Z")

</div>

Hi,

My guess is the following: Your field LastCheck contains a Date and Java returns the milliseconds since 01.01.1970 for this as this is the way the Date class stores it internally. Therefore, you receive 51 years which would be correct.

What you want is to calculate the time difference between now and the LastCheck and to return this in a human readable form.

Best regards  
Wolfram

---

<div class="post-metadata">

### Author: ![RamyaGowda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ramyagowda/32/27440_2.png) [@RamyaGowda](https://discuss.elastic.co/u/RamyaGowda)
#### Post date: [December 4, 2020, 8:18am UTC](https://discuss.elastic.co/t/datetime-in-human-readable-format-kibana/257618/3 "2020-12-04T08:18:50Z")

</div>

@Wolfram_Haussig , Your Awesome!!

It worked ,many thanks for your reply 😀

![image](https://us1.discourse-cdn.com/elastic/original/3X/c/6/c6d652e96b76485943e5994b670623488bc593bf.png)

Others, if you need this as reference

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/e/6edb9c826880c8dc6fe2dac3c8d93a70c49ef80f.png)

Thanks,  
Ramya

---

<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: [January 1, 2021, 8:18am UTC](https://discuss.elastic.co/t/datetime-in-human-readable-format-kibana/257618/4 "2021-01-01T08:18:57Z")

</div>

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