# How can I display current data and time in kibana canvas？

**URL:** <https://discuss.elastic.co/t/how-can-i-display-current-data-and-time-in-kibana-canvas/333011>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [May 10, 2023, 2:08am UTC](https://discuss.elastic.co/t/how-can-i-display-current-data-and-time-in-kibana-canvas/333011 "2023-05-10T02:08:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![1455929251](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/1455929251/32/120312_2.png) [@1455929251](https://discuss.elastic.co/u/1455929251)\
**Post date:** [May 10, 2023, 2:08am UTC](https://discuss.elastic.co/t/how-can-i-display-current-data-and-time-in-kibana-canvas/333011/1 "2023-05-10T02:08:53Z")

</div>

I want to add a shape element and show current data and time on it, like "2023-05-10 10:06:23" which can automatically refresh. But I can not find some function or system variables can query current time.

---

<div class="post-metadata">

**Author:** ![1455929251](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/1455929251/32/120312_2.png) [@1455929251](https://discuss.elastic.co/u/1455929251)\
**Post date:** [May 10, 2023, 3:01am UTC](https://discuss.elastic.co/t/how-can-i-display-current-data-and-time-in-kibana-canvas/333011/2 "2023-05-10T03:01:39Z")

</div>

Does anyone know how question，think you！

---

<div class="post-metadata">

**Author:** ![1455929251](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/1455929251/32/120312_2.png) [@1455929251](https://discuss.elastic.co/u/1455929251)\
**Post date:** [May 10, 2023, 7:03am UTC](https://discuss.elastic.co/t/how-can-i-display-current-data-and-time-in-kibana-canvas/333011/3 "2023-05-10T07:03:26Z")

</div>

Can anyone else help me, think you!

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [May 31, 2023, 10:19pm UTC](https://discuss.elastic.co/t/how-can-i-display-current-data-and-time-in-kibana-canvas/333011/4 "2023-05-31T22:19:29Z")

</div>

Hi @1455929251

There is a function reference that shows how to use the `date` function in Canvas: [https://www.elastic.co/guide/en/kibana/current/canvas-function-reference.html#date\_fn](https://www.elastic.co/guide/en/kibana/current/canvas-function-reference.html#date_fn)

An example of making a text string in a Canvas that shows the current date is:

```auto
date
| formatdate "MM/DD/YYYY HH:mm:ss"
| markdown "current time: " {context}
| render

```

I am not sure if there is a way to make this automatically refresh. I will ask the team if there is something that will emit a periodic trigger to make the `date` function return an up-to-date value.

In my experiments, I have seen the date is returned in UTC format, but I expected it to be in my current timezone.

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [May 31, 2023, 10:26pm UTC](https://discuss.elastic.co/t/how-can-i-display-current-data-and-time-in-kibana-canvas/333011/5 "2023-05-31T22:26:49Z")

</div>

One suggestion I've received is using Vega. You can use Vega to draw custom elements and have custom code that makes the element update itself using some timer code.

Here is the example: [Clock Example | Vega](https://vega.github.io/vega/examples/clock/)

---

<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:** [June 28, 2023, 10:27pm UTC](https://discuss.elastic.co/t/how-can-i-display-current-data-and-time-in-kibana-canvas/333011/6 "2023-06-28T22:27:18Z")

</div>

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