# Add date timestamp to name via math expression which will contain date and time

**URL:** <https://discuss.elastic.co/t/add-date-timestamp-to-name-via-math-expression-which-will-contain-date-and-time/221161>\
**Category:** Elasticsearch\
**Created:** [February 27, 2020, 7:46am UTC](https://discuss.elastic.co/t/add-date-timestamp-to-name-via-math-expression-which-will-contain-date-and-time/221161 "2020-02-27T07:46:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Davit\_Paytyan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davit_paytyan/32/63401_2.png) [@Davit\_Paytyan](https://discuss.elastic.co/u/Davit_Paytyan)\
**Post date:** [February 27, 2020, 7:46am UTC](https://discuss.elastic.co/t/add-date-timestamp-to-name-via-math-expression-which-will-contain-date-and-time/221161/1 "2020-02-27T07:46:15Z")

</div>

Hello,

I have a question about elasticsearch 7.4. We want to implement backup via snapshot lifecycle management API using time frame. Here is the query

**PUT /\_slm/policy/dailypolicy**

**{**

**"schedule": "\*/5 \* \* \* \* ?",**

**"name": "\<daily-snap\_{now+1h}\>",**

**"repository": "daily",**

**"config": {**

**"indices": ["\*"]**

**}**

**}**

We are trying to add date timestamp to name via math expression which will contain date and time. We have tried {now+1h} expression but it did no contain the time. If could help us how we can add timestamp ( example Resolves to: 2001-01-01 13:00:00) into name.

---

<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 26, 2020, 7:46am UTC](https://discuss.elastic.co/t/add-date-timestamp-to-name-via-math-expression-which-will-contain-date-and-time/221161/2 "2020-03-26T07:46:19Z")

</div>

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