# Painless get date today

**URL:** <https://discuss.elastic.co/t/painless-get-date-today/81264>\
**Category:** Elasticsearch\
**Created:** [April 5, 2017, 7:50am UTC](https://discuss.elastic.co/t/painless-get-date-today/81264 "2017-04-05T07:50:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [April 5, 2017, 1:39pm UTC](https://discuss.elastic.co/t/painless-get-date-today/81264/2 "2017-04-05T13:39:45Z")

</div>

Painless intentionally doesn't have any access to `now` style variables so they can be better cached. The current recommendation is for you to send `now` style variables in over scripts `params`.

BTW, you should know that this query isn't able to take advantage of the index at all. It'll have to load the `@timestamp` field for every document and compare it. This much much slower than extracting the day of the week on ingest and adding it to the document.

---

_[View the full topic](https://discuss.elastic.co/t/painless-get-date-today/81264)._
