How to get the days since some time using groovy script?

Say, I have a field with date type, I know I can get the total million
seconds of the date since the epoch by doc['date'].date.getMillis(), but is
there a function to get the total days directly?

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit