# What is the equivalent of now in script\_score decay function for DATE field

**URL:** <https://discuss.elastic.co/t/what-is-the-equivalent-of-now-in-script-score-decay-function-for-date-field/234424>\
**Category:** Elasticsearch\
**Created:** [May 26, 2020, 9:44pm UTC](https://discuss.elastic.co/t/what-is-the-equivalent-of-now-in-script-score-decay-function-for-date-field/234424 "2020-05-26T21:44:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elastic\_newbie](https://avatars.discourse-cdn.com/v4/letter/e/4bbf92/32.png) [@elastic\_newbie](https://discuss.elastic.co/u/elastic_newbie)\
**Post date:** [May 26, 2020, 9:44pm UTC](https://discuss.elastic.co/t/what-is-the-equivalent-of-now-in-script-score-decay-function-for-date-field/234424/1 "2020-05-26T21:44:41Z")

</div>

This is the current decay function which i am trying to convert this to script\_score decay function. What is the equivalent of "now" which i can use in script\_score

```auto
"functions": [
                        {
                            "linear": {
                                "date": {
                                    "origin": "now",
                                    "offset": "60d",
                                    "scale": "3590d",
                                    "decay": 0.5
                                }
                            }
                        }]

```

---

<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 27, 2020, 4:12am UTC](https://discuss.elastic.co/t/what-is-the-equivalent-of-now-in-script-score-decay-function-for-date-field/234424/3 "2020-06-27T04:12:30Z")

</div>

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