I want to change it so that now only uses the date part and not the time.
My usecase is to get previous day data for 24 hours e.g Between 00:00:00 and 23:59:59.
In other words the range should be [28-07-2020 to 29-07-2020].
Is there any extension on now like now.Date?
I was looking at painless script but not sure how to implement a functionality similar to range.
This answer is very close but I am not able to find how to find current date only without time.
Yes, this seems to be an UTC issue since 2020-07-30T01:17:49 +10:00 is the same as 2020-07-29T15:16:49 UTC - which is within the date range you wanted. So you'll need to handle that as well.
I haven't faced this issue myself, but perhaps you could try the time_zone parameter mentioned in the date range documentation? Quoting:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.