Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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?

asked 17 Apr '13, 10:29

Ilia63's gravatar image

Ilia63
1.2k515782
accept rate: 44%

edited 17 Apr '13, 18:23

Mark%20Culp's gravatar image

Mark Culp
24.9k10141297


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.

permanent link

answered 17 Apr '13, 18:22

Mark%20Culp's gravatar image

Mark Culp
24.9k10141297
accept rate: 41%

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:
alt text
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.

(18 Apr '13, 01:05) Ilia63
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×438
×11
×7

question asked: 17 Apr '13, 10:29

question was seen: 6,233 times

last updated: 18 Apr '13, 01:05