Time Zone


(yehuda) #1

Hi,

I'm trying to use the time zone option within a date histogram, since the hour I get is greater than the hour saved in elastic (by 2 hours).
I'm using 0.18.7.

This is my query:
{"query":{"filtered":{"query":{"range":{"date":{"from":"2011-12-18","to":"2011-12-18"}}},"filter":[{"terms":{"ctid":["11"]}}]}},"facets":{"date_sum_stats":{"date_histogram":{"key_field":"date","value_field":"sum","interval":"hour","time_zone":-2}}}}

And it returns this:
facets: {
date_sum_stats: {
_type: date_histogram
entries: [
{
time: 1324184400000
count: 2
min: 5
max: 10
total: 15
total_count: 2
mean: 7.5
}
{
time: 1324188000000
count: 1
min: 35
max: 35
total: 35
total_count: 1
mean: 35
}
]
}

1324188000000 epoch is "08" in hours (doing Time.at(1324188000000 / 1000).strftime("%H")) but the document is saved with the hour "06":
users
new_user
370563565
1
IE
US
11
2011-12-18T06:00:00+00:00
35

Any ideas?
I've tried also with 2 as time zone and with no time zone at all, but always getting same (wrong) hours.

Thanks,

Yehuda Zargarov


(system) #2