<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: UTC timestamp value issue with SQL anywhere 17 in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836327#M4867170</link>
    <description>&lt;PRE&gt;select connection_property('timestamp_with_time_zone_format'),
   connection_property('time_zone'), -- are TZs simulated?
   connection_property('time_zone_adjustment'),
   current timestamp,
   cast(current timestamp as timestamp with time zone),
   current utc timestamp
1)
yyyy-mm-dd hh:nn:ss.ssssss +hh:nn
2)
emptystring
3)
-300
4)
2023-11-09 03:21:52.000
5)
2023-11-09 03:21:52.000000 -05:00
6)
2023-11-09 08:21:52.000000 +00:00&lt;/PRE&gt;</description>
    <pubDate>Thu, 09 Nov 2023 03:29:33 GMT</pubDate>
    <dc:creator>former_SQLA_member1694919</dc:creator>
    <dc:date>2023-11-09T03:29:33Z</dc:date>
    <item>
      <title>UTC timestamp value issue with SQL anywhere 17</title>
      <link>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaq-p/13836324</link>
      <description>&lt;P&gt;we have declared the below column with table 1.&lt;/P&gt;
&lt;P&gt;last_chg_utc  datetime  null default utc timestamp,&lt;/P&gt;
&lt;P&gt;while inserting the row against table 1, default value is automatically populated for last_chg_utc column&lt;/P&gt;
&lt;P&gt;The problem is default value is inserting with adding future date for every insert.
For ex: today date is 08-11-2023 , default value is setting as 09-11-2023 for every insert it is incrementing the date value&lt;/P&gt;
&lt;P&gt;Note: we are not setting any value against (last_chg_utc column) by default it is settting the value&lt;/P&gt;
&lt;P&gt;kindly let us know why it is inserting the future date value by default.&lt;/P&gt;
&lt;P&gt;how to resolve this  automatic date increment issue&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 01:47:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaq-p/13836324</guid>
      <dc:creator>former_SQLA_member1694919</dc:creator>
      <dc:date>2023-11-08T01:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: UTC timestamp value issue with SQL anywhere 17</title>
      <link>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836328#M4867171</link>
      <description>&lt;P&gt;What is the date on the host server?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 05:06:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836328#M4867171</guid>
      <dc:creator>former_SQLA_member1694879</dc:creator>
      <dc:date>2023-11-08T05:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: UTC timestamp value issue with SQL anywhere 17</title>
      <link>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836329#M4867172</link>
      <description>&lt;P&gt;host server date is EST time today date&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 05:46:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836329#M4867172</guid>
      <dc:creator>former_SQLA_member1694919</dc:creator>
      <dc:date>2023-11-08T05:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: UTC timestamp value issue with SQL anywhere 17</title>
      <link>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836330#M4867173</link>
      <description>&lt;P&gt;If it's a Windows server run this in Powershell - it should output the date in UTC as you want it in SQL Anywhere - if it's not, then you need to look at the host server as your problem.&lt;/P&gt;
&lt;P&gt;Get-Date -date (Get-Date).ToUniversalTime()-uformat %y%m%d%H%M%j&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 06:21:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836330#M4867173</guid>
      <dc:creator>former_SQLA_member1694879</dc:creator>
      <dc:date>2023-11-08T06:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: UTC timestamp value issue with SQL anywhere 17</title>
      <link>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836325#M4867168</link>
      <description>&lt;P&gt;How do you "check" the timestamp values, i.e. with what query, and what is exactly displayed?&lt;/P&gt;
&lt;P&gt;I'm asking as the display of dates and timestamps is affected by settings for options like date_format or timestamp_with_time_zone_format, and with SQL Anywehre 17, you can also let the database server "run in a different time zone". &lt;/P&gt;
&lt;P&gt;What does this query reveal in DBISQL?&lt;/P&gt;
&lt;PRE&gt;select connection_property('timestamp_with_time_zone_format'),
   connection_property('time_zone'), -- are TZs simulated?
   connection_property('time_zone_adjustment'),
   current timestamp,
   cast(current timestamp as timestamp with time zone),
   current utc timestamp
&lt;/PRE&gt;

&lt;P&gt;Here's my German-based result (i.e. CET, UTC+1):
&lt;/P&gt;&lt;PRE&gt;YYYY-MM-DD HH:NN:SS.SSS+HH:NN;
;
60;
2023-11-08 13:23:58.241;
2023-11-08 13:23:58.241+01:00;
2023-11-08 12:23:58.241+00:00
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Note, the 5th column (current timestamp displayed with time zone) returns a different time than the 6th (current utc timestamp) because it isn't normalized to UTC0.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 07:30:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836325#M4867168</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2023-11-08T07:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: UTC timestamp value issue with SQL anywhere 17</title>
      <link>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836331#M4867174</link>
      <description>&lt;P&gt;FWIW, in the past, there have been some pitfalls with DEFAULT TIMESTAMP columns when the system clock was re-synchronized "back" according to changes due to DST or mere "inaccurate clocks" issues while the database server was running - as the DEFAULT IMESTAMP values seem to only increase monotonically while the database server is running and are prevented to "go back".&lt;/P&gt;
&lt;P&gt;I don't know if those issues also applied to DEFAULT UTC TIMESTAMP and apply to your problem - but you might &lt;A href="https://sqlanywhere-forum.sap.com/questions/18772/default-timestamp-and-system-clock"&gt;have a look here&lt;/A&gt;...&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 10:40:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836331#M4867174</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2023-11-08T10:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: UTC timestamp value issue with SQL anywhere 17</title>
      <link>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836326#M4867169</link>
      <description>&lt;P&gt;How do you "check" the timestamp values, i.e. with what query, and what is exactly displayed?&lt;/P&gt;
&lt;P&gt;After inserting a row into a table UTC timestamp column has been populated with the future date&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 03:26:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836326#M4867169</guid>
      <dc:creator>former_SQLA_member1694919</dc:creator>
      <dc:date>2023-11-09T03:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: UTC timestamp value issue with SQL anywhere 17</title>
      <link>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836327#M4867170</link>
      <description>&lt;PRE&gt;select connection_property('timestamp_with_time_zone_format'),
   connection_property('time_zone'), -- are TZs simulated?
   connection_property('time_zone_adjustment'),
   current timestamp,
   cast(current timestamp as timestamp with time zone),
   current utc timestamp
1)
yyyy-mm-dd hh:nn:ss.ssssss +hh:nn
2)
emptystring
3)
-300
4)
2023-11-09 03:21:52.000
5)
2023-11-09 03:21:52.000000 -05:00
6)
2023-11-09 08:21:52.000000 +00:00&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Nov 2023 03:29:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836327#M4867170</guid>
      <dc:creator>former_SQLA_member1694919</dc:creator>
      <dc:date>2023-11-09T03:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: UTC timestamp value issue with SQL anywhere 17</title>
      <link>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836332#M4867175</link>
      <description>&lt;P&gt;FWIW, I have formatted your code, you can do that itself via the CODE button or by including it with a pre tag pair...&lt;/P&gt;
&lt;P&gt;That being said, do these values fit for your time zone?
And do newly inserted/updated rows with DEFAULT UTC TIMESTAMP get higher values than "SELECT current utc timestamp" reveals?&lt;/P&gt;
&lt;P&gt;If so, what is the value of option default_timestamp_increment, as that defines how defaults are adapted/incremented when they might otherwise lead to identical values in columns with DEFAULT (UTC) TIMESTAMP.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 04:36:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/utc-timestamp-value-issue-with-sql-anywhere-17/qaa-p/13836332#M4867175</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2023-11-09T04:36:47Z</dc:date>
    </item>
  </channel>
</rss>

