I have a database (MS SQL) with a table "PositionMessages" with the columns
( ID as (int)
, issi as (varchar)
, Longitude as (varchar)
, Latitude as (varchar)
, Received_at as (datetime2)
)
The table is filled by a running jar on a server. Works fine. Database entry looks like this:
ID |issi |Longitude |Latitude |Received_at
301208 |6683904 |15,4464340209961 |46,9848775863647 |2017-07-25 06:37:21
The datetime is well set in UTC Format but when i load data into my webinterface of my project the datetime just adds 2 days and i didn't figured out why.
The SQL query looks like this: SELECT * FROM PositionMessages
In java i got the fileds via jdbc driver:
(com.microsoft.sqlserver.jdbc.SQLServerDriver)
tempTS = result.getTimestamp("received_at");
try {
result = source.executeStatement(query);
while (result.next()) {
tempID = result.getString("issi");
tempLong = result.getString("longitude");
tempLat = result.getString("latitude");
tempTS = result.getTimestamp("received_at");
tempLong = tempLong.replace(',', '.');
tempLat = tempLat.replace(',', '.');
route.add(new TetraDataset(tempID, tempLat, tempLong, tempTS));
}
return route;
} catch (SQLException e) {
System.err.println("ERROR WHILE READING THE ROUTE DATA FROM DB");
return null;
}
So, if i load the entry 2017-07-25 06:37:21 it looks like so in java tempTS 2017-07-27 06:37:21
Did someone had the same error?
Thanks for help!