<?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: Dataservices is sending wrong DATETIME value in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/dataservices-is-sending-wrong-datetime-value/qaa-p/12581610#M4718180</link>
    <description>&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;joseph_muiruri&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Dear Joseph, &lt;/P&gt;&lt;P&gt;I used utc_to_local. Error still keep going. &lt;/P&gt; 
&lt;PRE&gt;&lt;CODE&gt;utc_to_local((STG_INVOICE_TABLE.VBRK_FKDAT ||' '|| STG_INVOICE_TABLE.VBRK_ERZET), 'UTC+10')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I checked snowflake current timestamp.&lt;/P&gt;&lt;P&gt;select current_timestamp &amp;gt;&amp;gt; '2022-11-15 23:46:47.318 -0800'&lt;/P&gt;&lt;P&gt;My current hour is now &amp;gt;&amp;gt; '2022-11-16 10:46:47.318'&lt;/P&gt;&lt;P&gt;The photo below will help to understand the problem more closely. STAGE_DATE Merged version of VBRK_FKDAT and VBRK_ERZET. I want to see this date. I combine VBRK_FKDAT and VBRK_ERZET from Data Services and after I get 10 hours I send snowflake. This stands for INVOICEDATE. When I take the difference of INVOICEDATE and STAGE_DATE I get HOURDIFF. Randomly there are 10 and 11 hours difference. I'm trying to understand the problem.&lt;/P&gt;&lt;P&gt;Thank you for your interest.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2109933-image.png" /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Nov 2022 07:58:23 GMT</pubDate>
    <dc:creator>cader_berkay</dc:creator>
    <dc:date>2022-11-16T07:58:23Z</dc:date>
    <item>
      <title>Dataservices is sending wrong DATETIME value</title>
      <link>https://community.sap.com/t5/technology-q-a/dataservices-is-sending-wrong-datetime-value/qaq-p/12581606</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
  &lt;P&gt;Hope you folks doing well,&lt;/P&gt;
  &lt;P&gt;I have a problem when I load data to Snowflake with Dataservice. I have two columns. I concate these columns then I am creating new columns with DateTime format. When I load the data value is wrong. &lt;/P&gt;
  &lt;P&gt;VBRK_ERDAT = '2019-08-07'&lt;/P&gt;
  &lt;P&gt;VBRK_ERZET = '08:21:40'&lt;/P&gt;
  &lt;P&gt;I am using the below converting. &lt;/P&gt;
  &lt;P&gt;to_date(to_char(STG_INVOICE_TABLE.VBRK_FKDAT||' '||STG_INVOICE_TABLE.VBRK_ERZET, 'yyyy.mm.dd hh24:mi:ss'),'yyyy.mm.dd hh24:mi:ss')&lt;/P&gt;
  &lt;P&gt;I load data then I check data in Snowflake. It is coming wrong. &lt;/P&gt;
  &lt;P&gt;Snowflake &amp;gt;&amp;gt; '2019-08-01 22:21:40.000'&lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;Mehmet</description>
      <pubDate>Thu, 03 Nov 2022 08:57:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/dataservices-is-sending-wrong-datetime-value/qaq-p/12581606</guid>
      <dc:creator>cader_berkay</dc:creator>
      <dc:date>2022-11-03T08:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dataservices is sending wrong DATETIME value</title>
      <link>https://community.sap.com/t5/technology-q-a/dataservices-is-sending-wrong-datetime-value/qaa-p/12581607#M4718177</link>
      <description>&lt;P&gt;Dear Cafer,&lt;/P&gt;&lt;P&gt;In the example provided above, you have provided columns VBRK_ERZET and VBRK_ERDAT but in the conversion script you are calling different date column VBRK_FKDAT i would like to think this is why you are getting  2019-08-01  instead of 2019-08-07.&lt;/P&gt;&lt;P&gt;In the conversion script i don't see why you need to use to_char, from the documentation to_char function is used to convert date to a string but the output of the concatenation between the two columns is a string already, which renders the to_char redundant in this case.&lt;/P&gt;&lt;P&gt;Here is an example that converts columns VBRK_FKDAT = '2019-08-07'; and VBRK_ERZET = '08:21:40'; to &lt;/P&gt;&lt;P&gt;2019.08.07 08:21:40&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;to_date((STG_INVOICE_TABLE.VBRK_FKDAT||' '||$STG_INVOICE_TABLE.VBRK_ERZET), 'YYYY-MM-DD HH24:MI:SS');&lt;/P&gt;&lt;P&gt;Please see the following SAP KBA on how to convert AM/PM formats to 24hr/12hr time formats&lt;/P&gt;&lt;P&gt;&lt;A href="https://launchpad.support.sap.com/#/notes/0001831775" target="_blank"&gt;1831775&lt;/A&gt; - How to convert string date and time values with AM/PM to 24hr datetime format? - Data Services&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Joseph&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 10:45:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/dataservices-is-sending-wrong-datetime-value/qaa-p/12581607#M4718177</guid>
      <dc:creator>jmuiruri</dc:creator>
      <dc:date>2022-11-03T10:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dataservices is sending wrong DATETIME value</title>
      <link>https://community.sap.com/t5/technology-q-a/dataservices-is-sending-wrong-datetime-value/qaa-p/12581608#M4718178</link>
      <description>&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;joseph_muiruri&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Thanks Joseph,&lt;/P&gt;&lt;P&gt;I used to to_date() function. I uploaded data again. Covert Date is coming different offsets. It isn't possible to use utc_to_local(). I added photo for date convert process. I tried to many way for finding true value. &lt;/P&gt;&lt;P&gt;to_date((STG_INVOICE_TABLE.VBRK_FKDAT||' '||STG_INVOICE_TABLE.VBRK_ERZET), 'YYYY.MM.DD HH24:MI:SS')&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2109501-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 09:47:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/dataservices-is-sending-wrong-datetime-value/qaa-p/12581608#M4718178</guid>
      <dc:creator>cader_berkay</dc:creator>
      <dc:date>2022-11-04T09:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dataservices is sending wrong DATETIME value</title>
      <link>https://community.sap.com/t5/technology-q-a/dataservices-is-sending-wrong-datetime-value/qaa-p/12581609#M4718179</link>
      <description>&lt;P&gt;Dear Cafer,&lt;/P&gt;&lt;P&gt;I you wanted to use utc_to_local, then there is no need of using to_date function.&lt;/P&gt;&lt;P&gt;you could use for Example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;$VBRK_FKDAT = '2019-12-04';
$VBRK_ERZET = '10:58:32';
$results = utc_to_local( ($VBRK_FKDAT||' '||$VBRK_ERZET),'UTC+3');
print($results);
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Results in:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;2019.12.04 13:58:32 # offset 3hrs UTC+3 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Joseph&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 17:57:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/dataservices-is-sending-wrong-datetime-value/qaa-p/12581609#M4718179</guid>
      <dc:creator>jmuiruri</dc:creator>
      <dc:date>2022-11-04T17:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dataservices is sending wrong DATETIME value</title>
      <link>https://community.sap.com/t5/technology-q-a/dataservices-is-sending-wrong-datetime-value/qaa-p/12581610#M4718180</link>
      <description>&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;joseph_muiruri&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Dear Joseph, &lt;/P&gt;&lt;P&gt;I used utc_to_local. Error still keep going. &lt;/P&gt; 
&lt;PRE&gt;&lt;CODE&gt;utc_to_local((STG_INVOICE_TABLE.VBRK_FKDAT ||' '|| STG_INVOICE_TABLE.VBRK_ERZET), 'UTC+10')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I checked snowflake current timestamp.&lt;/P&gt;&lt;P&gt;select current_timestamp &amp;gt;&amp;gt; '2022-11-15 23:46:47.318 -0800'&lt;/P&gt;&lt;P&gt;My current hour is now &amp;gt;&amp;gt; '2022-11-16 10:46:47.318'&lt;/P&gt;&lt;P&gt;The photo below will help to understand the problem more closely. STAGE_DATE Merged version of VBRK_FKDAT and VBRK_ERZET. I want to see this date. I combine VBRK_FKDAT and VBRK_ERZET from Data Services and after I get 10 hours I send snowflake. This stands for INVOICEDATE. When I take the difference of INVOICEDATE and STAGE_DATE I get HOURDIFF. Randomly there are 10 and 11 hours difference. I'm trying to understand the problem.&lt;/P&gt;&lt;P&gt;Thank you for your interest.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2109933-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 07:58:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/dataservices-is-sending-wrong-datetime-value/qaa-p/12581610#M4718180</guid>
      <dc:creator>cader_berkay</dc:creator>
      <dc:date>2022-11-16T07:58:23Z</dc:date>
    </item>
  </channel>
</rss>

