Curl result of a time range query is 8 hours earlier which is not my timezone

elasticsearch works in UTC. The client is responsible for adjusting times to the local timezone. For Kibana, Kibana does it. For your Java app, the app must do it.