elastic / elasticsearch-sql-odbc

ODBC driver for Elasticsearch SQL
Other
0 stars 30 forks source link

Apply DST #142

Closed bpintea closed 5 years ago

bpintea commented 5 years ago

This PR fixes the application of the DST offset, both to time values, in case local times are used, and to the time_zone request parameter sent to ES.

It also enables the calculation of this offset on a per-request basis, thus making the driver work correctly during the DST setting changing (i.e. it should not require an application restart after the local time advanced or was set back).

droberts195 commented 5 years ago

Is this applying the current UTC offset to all dates received from the server?

If so then it won't produce the correct results for documents with times from a different part of the year. For example, now it's April 2019 so the UK is 3600 seconds ahead of UTC. But if I select a document with a time from December 2018 then the correct offset for the UK is 0. Would this change return the December timestamp converted to summer time?

bpintea commented 5 years ago

Is this applying the current UTC offset to all dates received from the server?

The driver uses now C lib's time functions, which will do the localtime - UTC conversions individually for the provided timestamp.