Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Timezone issue when retrieving date from Elasticsearch (UTC considered as local) #1062

@milantar

Description

@milantar

Hello,
It seems that a datefield retrieved by opendistro jdbc (opendistro-sql-jdbc-1.2.0.0.jar) from Elasticsearch (7.2.0) is retrieved as local (displayed in JasperServer).
Elasticsearch stores the date as UTC:
{ "_index" : "record-deletion-logs", "_type" : "_doc", "_id" : "jhTO1HcBu5s5PDfU9iUG", "_score" : 8.962324, "_source" : { ... "operationdate" : "2021-01-18T11:17:41.529Z", }
Afetr querying with opendistro:
select external_id, operationdate from record-deletion-logs WHERE external_id like 100801210112003515%'
the date '2021-01-18 11:17:41.529' is considered local (TZ +1 in my case), so I display the UTC date at the local time. If I override the timezone, the date shifts accordingly, if I force the timezone to UTC the resulting date is '2021-01-18 10:17:41.529'.
Attached a screenshot of the date retrieved from Jasper
DateManagement issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions