# What are supported date unit in Decay function?

**URL:** <https://discuss.elastic.co/t/what-are-supported-date-unit-in-decay-function/96199>\
**Category:** Elasticsearch\
**Created:** [August 8, 2017, 7:12am UTC](https://discuss.elastic.co/t/what-are-supported-date-unit-in-decay-function/96199 "2017-08-08T07:12:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Youxu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/youxu/32/117375_2.png) [@Youxu](https://discuss.elastic.co/u/Youxu)\
**Post date:** [August 8, 2017, 7:12am UTC](https://discuss.elastic.co/t/what-are-supported-date-unit-in-decay-function/96199/1 "2017-08-08T07:12:59Z")

</div>

I tried decay function on ES 5.2 as follows:

```auto
      "functions": [
	    {
            "gauss": {
                "AvailableDate": {
                    "scale": "3w",
                    "offset": "6w",
                    "decay": 0.9
                }
            }
        }

```

I thought 3w mean 3 weeks, but I got following error:  
"failed to parse setting [DecayFunctionParser.scale] with value [3w] as a time value: unit is missing or unrecognized"

I also tried 'd', 'm', 'y', 'M' etc. only 'd' and 'm' work, but seems 'm' means minute not month, right?

So my question is, what are supported date unit in decay function?

---

<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:** [September 5, 2017, 7:13am UTC](https://discuss.elastic.co/t/what-are-supported-date-unit-in-decay-function/96199/2 "2017-09-05T07:13:15Z")

</div>

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