# Painless script, get error dynamic method \[java.lang.Long, getMillis/0\] not found

**URL:** <https://discuss.elastic.co/t/painless-script-get-error-dynamic-method-java-lang-long-getmillis-0-not-found/250240>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [September 28, 2020, 5:07pm UTC](https://discuss.elastic.co/t/painless-script-get-error-dynamic-method-java-lang-long-getmillis-0-not-found/250240 "2020-09-28T17:07:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![perezbrandon](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@perezbrandon](https://discuss.elastic.co/u/perezbrandon)\
**Post date:** [September 28, 2020, 5:07pm UTC](https://discuss.elastic.co/t/painless-script-get-error-dynamic-method-java-lang-long-getmillis-0-not-found/250240/1 "2020-09-28T17:07:00Z")

</div>

So when i run this script,

```auto
doc['date_updated'].value.getMillis() > params.one_day ? 1.9

```

i get the error `dynamic method [java.lang.Long, getMillis/0] not found`  
Im not sure what this error means or if im missing something from installing java or elasticsearch.

im using elasticsearch 6.8.12.  
JAVA 8

I added the variable JAVA\_HOME and assigned it the path to the java executable in the elasticsearch-env but that didnt seem to do much.

If anyone can just help me understand this error.

Any help you be greatly appreciated

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [September 29, 2020, 9:55am UTC](https://discuss.elastic.co/t/painless-script-get-error-dynamic-method-java-lang-long-getmillis-0-not-found/250240/2 "2020-09-29T09:55:00Z")

</div>

try `doc['@timestamp'].value.millis` - also, please check your mapping if `date_updated` really is mapped as a timestamp field, as it looks me that it is mapped as a regular long.

---

<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:** [October 27, 2020, 9:55am UTC](https://discuss.elastic.co/t/painless-script-get-error-dynamic-method-java-lang-long-getmillis-0-not-found/250240/3 "2020-10-27T09:55:01Z")

</div>

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