# Updating TTL

**URL:** <https://discuss.elastic.co/t/updating-ttl/8234>\
**Category:** Elasticsearch\
**Created:** [June 26, 2012, 11:42pm UTC](https://discuss.elastic.co/t/updating-ttl/8234 "2012-06-26T23:42:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![William\_King](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/william_king/32/2631_2.png) [@William\_King](https://discuss.elastic.co/u/William_King)\
**Post date:** [June 26, 2012, 11:42pm UTC](https://discuss.elastic.co/t/updating-ttl/8234/1 "2012-06-26T23:42:18Z")

</div>

When you update a documents TTL will the TTL be set to expire from the time  
of update or the original index time?

For example if I have a document with a TTL of 2 days indexed on Monday, it  
would then expire on Wednesday

HOWEVER if I update that TTL on Tuesday, again setting it to 2 days, would  
the document still expire on Wednesday (2 days from Monday) or Thursday (2  
days from Tuesday) ?

---

<div class="post-metadata">

**Author:** ![Benjamin\_Deveze](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benjamin_deveze/32/1577_2.png) [@Benjamin\_Deveze](https://discuss.elastic.co/u/Benjamin_Deveze)\
**Post date:** [June 27, 2012, 8:26am UTC](https://discuss.elastic.co/t/updating-ttl/8234/2 "2012-06-27T08:26:16Z")

</div>

Hey William,

if you don't provide a timestamp yourself, the timestamp of the  
document will be set to the update date and the new expiration time  
will be computed relatively to this timestamp. So to answer your  
question your updated document will expire on Thursday if you update  
it on Tuesday.

On Wed, Jun 27, 2012 at 1:42 AM, William King [willtrking@gmail.com](mailto:willtrking@gmail.com) wrote:

> When you update a documents TTL will the TTL be set to expire from the time  
> of update or the original index time?
> 
> For example if I have a document with a TTL of 2 days indexed on Monday, it  
> would then expire on Wednesday
> 
> HOWEVER if I update that TTL on Tuesday, again setting it to 2 days, would  
> the document still expire on Wednesday (2 days from Monday) or Thursday (2  
> days from Tuesday) ?

--  
Benjamin DEVEZE

---

<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:** [July 6, 2017, 3:22am UTC](https://discuss.elastic.co/t/updating-ttl/8234/3 "2017-07-06T03:22:22Z")

</div>

Closed on July 6, 2017, 3:22am UTC


