Thomas,

The TimeValue class handles precisely defined time periods (well, pretty 
much, anyway). In other words, 1s is one second. 1w is always 7d (leap 
seconds notwithstanding, but that doesn't really affect the precision).

But what is one year? 365 days? 365.25 days? 366 days in a leap year?

What is one quarter? Exactly 91.25d (which is 365 / 4)? Or 3 months? 

But then, what is a month? 28 days? 31 days? Use 28d or 31d if that's what 
you mean; 1 month has no deterministic meaning all by itself. And 1 quarter 
is 3 months but without any deterministic way to convert to a precise 
number of milliseconds.

The TimeValue class has no support for locale nor day of year nor leap year 
nor days in a month. It's best to use Joda time if you wish to perform 
proper year-oriented calculations. And it will return milliseconds 
precision if you wish, which will plug directly back into a TimeValue.

Brian

-- 
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 elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/05798106-2a3d-4b7a-8a06-572116e0694b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to