We have a Sybase database that currently stores datetime values in some of the tables. If we move that server with the Sybase database to another country which is in another time zone, will the datetime values in the database be represented differently?
In other words, consider the scenario:
The Sybase database runs in timezone +2:00.
From my Java app that lives in time zone +1:00, it writes to the database 1 Jan 1970, 1:00 which is epoch 0 in the app's time zone.
preparedStatement.setTimestamp(3, new Timestamp(0));
However, when I query the database using SQL Workbench/J client (in time zone +1:00), I see
in my table. In fact, it does not matter to which time zone I change my computer's clock, SQL Workbench/J client always reads
1970-01-01 01:00:00 from the database.
Another Java client that lives in time zone +3:00 reads the same value as
which translates to epoch
-2:00 in the client's time zone!
So to get back to my original question, does Sybase store datetime values as e.g. strings or epochs? I do not have a free Sybase server that I can experiment on, so what can we expect to happen when we move the server to another country with a different time zone?
The type we use is "datetime", for example:
CREATE TABLE "dbo"."whatever" (eventDate datetime NOT NULL);