# Kibana Canvas - Markdown date format

**URL:** <https://discuss.elastic.co/t/kibana-canvas-markdown-date-format/256807>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [November 26, 2020, 5:45pm UTC](https://discuss.elastic.co/t/kibana-canvas-markdown-date-format/256807 "2020-11-26T17:45:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KevSex](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kevsex/32/29031_2.png) [@KevSex](https://discuss.elastic.co/u/KevSex)\
**Post date:** [November 26, 2020, 5:45pm UTC](https://discuss.elastic.co/t/kibana-canvas-markdown-date-format/256807/1 "2020-11-26T17:45:56Z")

</div>

Is there a way to use the markdown content to write the previous month?

Just now, I use `{date | formatdate "MMMM YYYY"}` which produces `November 2020` however I'm wondering if there's a way to write the last months date. e.g. `October 2020`.

Cheers,  
Kev

---

<div class="post-metadata">

**Author:** ![clintandrewhall](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clintandrewhall/32/45435_2.png) [@clintandrewhall](https://discuss.elastic.co/u/clintandrewhall)\
**Post date:** [November 27, 2020, 7:50pm UTC](https://discuss.elastic.co/t/kibana-canvas-markdown-date-format/256807/2 "2020-11-27T19:50:08Z")

</div>

Good morning, Kev!

This is tough one. Unfortunately, I don't think you're going to be able to do this with `date` or `formatdate` alone, because date math is tough to begin with. We don't (currently) expose date manipulation functionality, (though I suppose we could at some point).

One solution would be to subtract 30 days from epoch (but isn't 100% accurate, as months vary in length):

`date | math "subtract(value, 2592000000)" | formatdate format="MMMM YYYY"`

You can always file an enhancement request for us to expose `momentjs` date manipulation as a function, or write one yourself and include it as a plugin in Canvas. Otherwise, I'm afraid you're left with trying to perform the date math as part of your query, or other approach.

---

<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 25, 2020, 7:50pm UTC](https://discuss.elastic.co/t/kibana-canvas-markdown-date-format/256807/3 "2020-12-25T19:50:21Z")

</div>

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