on 2013 Apr 17 11:29 AM
I'm in a UTC+03:00 time zone.
I run operators and get the following values:
SELECT CONNECTION_PROPERTY( 'TimeZoneAdjustment'); ==> 180
SELECT datediff(minute,CURRENT UTC TIMESTAMP, CURRENT TIMESTAMP); ==> 180
When I change the time zone on my computer to UTC+08:00 (and reboot the dbsrv12), I get the following
values:
SELECT CONNECTION_PROPERTY( 'TimeZoneAdjustment'); ==> 180
SELECT datediff(minute,CURRENT UTC TIMESTAMP, CURRENT TIMESTAMP); ==> 480
Therefore, does not work correctly TimeZoneAdjustment?
Request clarification before answering.
What computer are you using to connect to the server? My guess is that it is a different computer than the one where the server is running.
The connection property returns the time zone adjustment value for the client - it does this by using the timezone data which is passed from the client to the server. Therefore CONNECTION_PROPERTY('TimeZoneAdjustment') will remain at 180 (3 hours) if you did not change the timezone of the computer from which you are connecting.
The datediff computation is correct because on the server the difference is eight hours = 480 minutes.
Note that this documentation page states that the TimeZoneAdjustment connection property:
Returns the number of minutes that must be added to the Coordinated Universal Time (UTC) > to display time local to the connection. See time_zone_adjustment option.
So it appears that the software is working as expected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The server and client are located on the same computer.
A) UTC+03:00
SQL Anywhere Network Server Version 12.0.1.3537
Database server started at Thu Apr 18 2013 08:51
Starting database "D4w" (D:asaDT00013712253D4w.db) at Thu Apr 18 2013 08:51
Database "D4w" (D4w.db) started at Thu Apr 18 2013 08:51
Interactive SQL:
SELECT CONNECTION_PROPERTY( 'TimeZoneAdjustment' );
==> 180
SELECT CURRENT UTC TIMESTAMP, CURRENT TIMESTAMP, datediff(minute,CURRENT UTC TIMESTAMP, CURRENT TIMESTAMP);
==> '2013-04-18 05:54:52.517+00:00','2013-04-18 08:54:52.517',180
B) Change to UTC+8:00 + shutdown & restart dbsrv12:
SQL Anywhere Network Server Version 12.0.1.3537
Database server started at Thu Apr 18 2013 13:56
Starting database "D4w" (D:asaDT00013712253D4w.db) at Thu Apr 18 2013 13:56
Database "D4w" (D4w.db) started at Thu Apr 18 2013 13:56
Interactive SQL:
SELECT CONNECTION_PROPERTY( 'TimeZoneAdjustment' );
==> 180
SELECT CURRENT UTC TIMESTAMP, CURRENT TIMESTAMP, datediff(minute,CURRENT UTC TIMESTAMP, CURRENT TIMESTAMP);
==> '2013-04-18 05:59:09.700+00:00','2013-04-18 13:59:09.700',480
P.S. To get the correct TimeZoneAdjustment-parameter values have to restart my computer.
User | Count |
---|---|
50 | |
10 | |
8 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.