# Scripted Fields Date Math

**URL:** <https://discuss.elastic.co/t/scripted-fields-date-math/158649>\
**Category:** Kibana\
**Created:** [November 28, 2018, 8:39pm UTC](https://discuss.elastic.co/t/scripted-fields-date-math/158649 "2018-11-28T20:39:25Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [November 28, 2018, 10:09pm UTC](https://discuss.elastic.co/t/scripted-fields-date-math/158649/2 "2018-11-28T22:09:16Z")

</div>

> [@kb2295](#):
>
> LocalDateTime.now().value

Painless intentionally doesn't expose .now() style methods per [Groovy to Painless; get current date time](https://discuss.elastic.co/t/groovy-to-painless-get-current-date-time/95471)

You can get the milliseconds of the document's @timestamp field using the following `doc['@timestamp'].value.getMillis()`

---

_[View the full topic](https://discuss.elastic.co/t/scripted-fields-date-math/158649)._
