<?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>topic Re: Adding Hours to existing UTC Timestamp in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Adding-Hours-to-existing-UTC-Timestamp/m-p/2421159#M140193</link>
    <description>&lt;P&gt;Hi there, you can use Talend.addDate to add the 4 hrs. I'm not sure exactly what you are doing but you can format the current date straight into the UTC format. Also, if you need it in local timezone there are options for that too. No need to build the date and time separately I think.&lt;/P&gt;
&lt;P&gt;try using&amp;nbsp;TalendDate.formatDateInTimeZone("yyyy-MM-dd'T'HH:mm:ss'Z'",varDate,"Australia/Sydney"))&lt;/P&gt;
&lt;P&gt;where varDate is the UTC date you are working with. To add to a date (or subtract) you can use something like this:&lt;/P&gt;
&lt;P&gt;TalendDate.addDate(row8.enddate,"yyyy-MM-ddT",-1,"dd")&lt;/P&gt;
&lt;P&gt;which subtracts a day from the date part of row8.enddate. You would need to modify the date format to suit your data, and change dd to HH. Take a look at the help for the function, here's a snippet below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;add number of day, month ... to a date (with Date given in String with a pattern)&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/120368"&gt;@param&lt;/a&gt; date (a Date given in string)&lt;BR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/120368"&gt;@param&lt;/a&gt; pattern (the pattern for the related date)&lt;BR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/120368"&gt;@param&lt;/a&gt; nb (the value to add)&lt;BR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/120368"&gt;@param&lt;/a&gt; dateType (date pattern = ("yyyy","MM","dd","HH","mm","ss","SSS" ))&lt;BR /&gt;@return a new date&lt;/P&gt;
&lt;P&gt;Hope that helps&lt;/P&gt;
&lt;P&gt;Andrew&lt;/P&gt;</description>
    <pubDate>Tue, 20 Feb 2024 12:15:01 GMT</pubDate>
    <dc:creator>BraidwoodIT</dc:creator>
    <dc:date>2024-02-20T12:15:01Z</dc:date>
    <item>
      <title>Adding Hours to existing UTC Timestamp</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-Hours-to-existing-UTC-Timestamp/m-p/2418943#M140161</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;Can someone help me with a solution as Talend is pretty new to me.&lt;/P&gt;
&lt;P&gt;Currently I am pulling data out of API where I have to pass todate and fromdate in UTC to limit the data being pulled.&lt;/P&gt;
&lt;P&gt;I have a context variable&amp;nbsp;"incremental_timestamp"&amp;nbsp; which gets the data from database ex format is&amp;nbsp;2024-02-09T17:00:56Z and this database value is fed through variable&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"incremental_timestamp_utc" =&amp;nbsp;TalendDate.formatDateInUTC("yyyy-MM-dd", TalendDate.getCurrentDate())+"T"+TalendDate.formatDateInUTC("HH:mm:ss", TalendDate.getCurrentDate())+"Z"&lt;/P&gt;
&lt;P&gt;Now I need to add exactly 4 hours to context variable&lt;/P&gt;
&lt;P&gt;Ex NewPlus4hourvariable = "incremental_timestamp" + 4 hours and result should be&amp;nbsp;2024-02-09T21:00:56Z&lt;/P&gt;
&lt;P&gt;Does this work?&lt;/P&gt;
&lt;P&gt;NewPlus4hourvariable =&amp;nbsp;"incremental_timestamp" +&amp;nbsp;&lt;SPAN&gt;MakeTime(4,0) does this give me&amp;nbsp;2024-02-09T21:00:56Z ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;If not how can I achive this?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help much appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 17:36:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-Hours-to-existing-UTC-Timestamp/m-p/2418943#M140161</guid>
      <dc:creator>ManjunathBhat</dc:creator>
      <dc:date>2024-02-14T17:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Hours to existing UTC Timestamp</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-Hours-to-existing-UTC-Timestamp/m-p/2421159#M140193</link>
      <description>&lt;P&gt;Hi there, you can use Talend.addDate to add the 4 hrs. I'm not sure exactly what you are doing but you can format the current date straight into the UTC format. Also, if you need it in local timezone there are options for that too. No need to build the date and time separately I think.&lt;/P&gt;
&lt;P&gt;try using&amp;nbsp;TalendDate.formatDateInTimeZone("yyyy-MM-dd'T'HH:mm:ss'Z'",varDate,"Australia/Sydney"))&lt;/P&gt;
&lt;P&gt;where varDate is the UTC date you are working with. To add to a date (or subtract) you can use something like this:&lt;/P&gt;
&lt;P&gt;TalendDate.addDate(row8.enddate,"yyyy-MM-ddT",-1,"dd")&lt;/P&gt;
&lt;P&gt;which subtracts a day from the date part of row8.enddate. You would need to modify the date format to suit your data, and change dd to HH. Take a look at the help for the function, here's a snippet below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;add number of day, month ... to a date (with Date given in String with a pattern)&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/120368"&gt;@param&lt;/a&gt; date (a Date given in string)&lt;BR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/120368"&gt;@param&lt;/a&gt; pattern (the pattern for the related date)&lt;BR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/120368"&gt;@param&lt;/a&gt; nb (the value to add)&lt;BR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/120368"&gt;@param&lt;/a&gt; dateType (date pattern = ("yyyy","MM","dd","HH","mm","ss","SSS" ))&lt;BR /&gt;@return a new date&lt;/P&gt;
&lt;P&gt;Hope that helps&lt;/P&gt;
&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 12:15:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-Hours-to-existing-UTC-Timestamp/m-p/2421159#M140193</guid>
      <dc:creator>BraidwoodIT</dc:creator>
      <dc:date>2024-02-20T12:15:01Z</dc:date>
    </item>
  </channel>
</rss>

