# Dates are shifted by 1 day using JDBC Driver

**URL:** https://community.dremio.com/t/dates-are-shifted-by-1-day-using-jdbc-driver/377
**Category:** Uncategorized
**Created:** [October 17, 2017, 12:15am UTC](https://community.dremio.com/t/dates-are-shifted-by-1-day-using-jdbc-driver/377 "2017-10-17T00:15:10Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![david.lee](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@david.lee](https://community.dremio.com/u/david.lee)
#### Post date: [October 17, 2017, 12:15am UTC](https://community.dremio.com/t/dates-are-shifted-by-1-day-using-jdbc-driver/377/1 "2017-10-17T00:15:10Z")

</div>

For some reason the JDBC driver results are shifting Dates by a day. I’m querying a parquet file.

Dremio CSV download - Matches Dremio UI

2017-09-18T00:00:00.000 397.6321  
2017-09-19T00:00:00.000 398.07657  
2017-09-20T00:00:00.000 398.32816  
2017-09-21T00:00:00.000 397.12952  
2017-09-22T00:00:00.000 397.39453

Exact same Dremio SQL Query using JDBC Driver

9/18/2017 398.07657  
9/19/2017 398.32816  
9/20/2017 397.12952  
9/21/2017 397.39453  
9/22/2017 397.39453

Running the query with a specific day in JDBC returns back:

where as\_of = ‘2017-09-19’

as\_of tri\_price  
9/18/2017 398.07657

---

<div class="post-metadata">

### Author: ![david.lee](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@david.lee](https://community.dremio.com/u/david.lee)
#### Post date: [October 17, 2017, 12:42am UTC](https://community.dremio.com/t/dates-are-shifted-by-1-day-using-jdbc-driver/377/2 "2017-10-17T00:42:41Z")

</div>

I checked the data with both Apache Drill and Apache Spark and both returned the back the correct date and price. Looks like a Dremio JDBC specific problem,

Tried:  
Spark SQL using SparkR  
Drill SQL using Drill UI  
Drill SQL using Drill JDBC

and as\_of = ‘2017-09-19’

as\_of tri\_price  
9/19/2017 398.07657

---

<div class="post-metadata">

### Author: ![laurent](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/laurent/32/16_2.png) [@laurent](https://community.dremio.com/u/laurent)
#### Post date: [October 18, 2017, 4:13pm UTC](https://community.dremio.com/t/dates-are-shifted-by-1-day-using-jdbc-driver/377/3 "2017-10-18T16:13:25Z")

</div>

Hey @david.lee,

can you share which version of the server and the driver you are using, along with the [query profile](https://community.dremio.com/t/how-to-share-a-query-profile/148)?

---

<div class="post-metadata">

### Author: ![david.lee](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@david.lee](https://community.dremio.com/u/david.lee)
#### Post date: [October 18, 2017, 9:05pm UTC](https://community.dremio.com/t/dates-are-shifted-by-1-day-using-jdbc-driver/377/4 "2017-10-18T21:05:10Z")

</div>

Build  
1.2.2-201710100154510864-d40e31c  
Edition  
Community Edition  
Build Time  
10/09/2017 18:56:36  
Change Hash  
d40e31c9961b60737eb802375c1246264465dc06  
Change Time  
10/09/2017 18:49:44

JDBC Driver:  
dremio-jdbc-driver-1.2.2-201710100154510864-d40e31c.jar

Profile Attached:  
[c831f4ac-9473-45e6-a879-457650793fcd.zip](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/1X/70ab45e321693fb176594f606ce91281b935f5b6.zip) (3.4 KB)

I tried downgrading to 1.2.1, but it has the same problem… 1.1.0 has the bug that doesn’t read dates properly: -11355-04-22

---

<div class="post-metadata">

### Author: ![david.lee](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@david.lee](https://community.dremio.com/u/david.lee)
#### Post date: [October 18, 2017, 9:43pm UTC](https://community.dremio.com/t/dates-are-shifted-by-1-day-using-jdbc-driver/377/5 "2017-10-18T21:43:32Z")

</div>

The example above returns back in Dremio UI

SELECT \* FROM “temp”.“0\_0\_0.parquet” where as\_of = ‘2009-07-06’ limit 10

{“msr”:“F000002N19”,“as\_of”:“2009-07-06”,“tri\_price”:25.04}  
{“msr”:“F000002OWJ”,“as\_of”:“2009-07-06”,“tri\_price”:22.646044}  
{“msr”:“F000002VFB”,“as\_of”:“2009-07-06”,“tri\_price”:19.32}  
{“msr”:“F000002XFA”,“as\_of”:“2009-07-06”,“tri\_price”:50.10911}  
{“msr”:“F00000J3JR”,“as\_of”:“2009-07-06”,“tri\_price”:80.568016}  
{“msr”:“F00000LVTA”,“as\_of”:“2009-07-06”,“tri\_price”:35.206165}  
{“msr”:“FEUSA00001”,“as\_of”:“2009-07-06”,“tri\_price”:121.10718}  
{“msr”:“FEUSA00002”,“as\_of”:“2009-07-06”,“tri\_price”:104.68655}  
{“msr”:“FEUSA00003”,“as\_of”:“2009-07-06”,“tri\_price”:36.369663}  
{“msr”:“FEUSA00004”,“as\_of”:“2009-07-06”,“tri\_price”:128.56389}

But the same query using a JDBC BI tool or R (using RJDBC) gives:

msr as\_of tri\_price  
F000002N19 7/5/2009 25.04  
F000002OWJ 7/5/2009 22.646044  
F000002VFB 7/5/2009 19.32  
F000002XFA 7/5/2009 50.10911  
F00000J3JR 7/5/2009 80.568016  
F00000LVTA 7/5/2009 35.206165  
FEUSA00001 7/5/2009 121.10718  
FEUSA00002 7/5/2009 104.68655  
FEUSA00003 7/5/2009 36.369663  
FEUSA00004 7/5/2009 128.56389

---

<div class="post-metadata">

### Author: ![laurent](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/laurent/32/16_2.png) [@laurent](https://community.dremio.com/u/laurent)
#### Post date: [October 19, 2017, 3:51pm UTC](https://community.dremio.com/t/dates-are-shifted-by-1-day-using-jdbc-driver/377/6 "2017-10-19T15:51:57Z")

</div>

Thanks @david.lee, we have been able to reproduce the issue and we will be working on a fix.

---

<div class="post-metadata">

### Author: ![laurent](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/laurent/32/16_2.png) [@laurent](https://community.dremio.com/u/laurent)
#### Post date: [November 29, 2017, 4:58pm UTC](https://community.dremio.com/t/dates-are-shifted-by-1-day-using-jdbc-driver/377/7 "2017-11-29T16:58:43Z")

</div>

Hey @david.lee,

just to let you know we released Dremio 1.3.0 which contains the fix for this issue.
