<?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: tMap Expression Function to convert UTC to local time in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tMap-Expression-Function-to-convert-UTC-to-local-time/m-p/2298353#M70833</link>
    <description>&lt;P&gt;Is there a function in tMap to convert the UTC into the local time?&lt;/P&gt;&lt;P&gt;If I format the date as "Z" in tMap, then I get the -0800 or -0700 (timeZone column below) &lt;/P&gt;&lt;P&gt;If I format the date "yyyy-MM-dd HH:mm:ss.SSSXXX", then I get the date and the time zone (convertedDate column)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to use this? Subtract the timeZone from the originalDate to get the local time?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000009ryz3AAA.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131904iC78A6947F94B2F50/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000009ryz3AAA.jpg" alt="0693p000009ryz3AAA.jpg" /&gt;&lt;/span&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Oct 2020 17:36:56 GMT</pubDate>
    <dc:creator>Edith1</dc:creator>
    <dc:date>2020-10-08T17:36:56Z</dc:date>
    <item>
      <title>tMap Expression Function to convert UTC to local time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMap-Expression-Function-to-convert-UTC-to-local-time/m-p/2298349#M70829</link>
      <description>&lt;P&gt;Hello, thanks in advance for reading and helping me out with the following question. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Data Catalog, there's an attribute of "last modified date" and it shows both the Local Time and UTC Time.  When I pull this data using the Data Catalog API, I'm only getting the UTC time. Is there a function or expression in tMap to convert the UTC to local?  In the below picture, the API pulls 2020-10-05 22:26:32.  Is there a way to convert this to 15:26:32? I was looking at the Talend Date functions, but not sure how to use them.  Would&lt;B&gt; tformatDateLocale()&lt;/B&gt; work?   &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000009rjZDAAY.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144658iE5DE3E8C25553766/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000009rjZDAAY.jpg" alt="0693p000009rjZDAAY.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here's a picture of my job. &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000009rjvBAAQ.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157728i159CD18FBAC1A4D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000009rjvBAAQ.jpg" alt="0693p000009rjvBAAQ.jpg" /&gt;&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 16:50:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMap-Expression-Function-to-convert-UTC-to-local-time/m-p/2298349#M70829</guid>
      <dc:creator>Edith1</dc:creator>
      <dc:date>2020-10-07T16:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: tMap Expression Function to convert UTC to local time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMap-Expression-Function-to-convert-UTC-to-local-time/m-p/2298350#M70830</link>
      <description>&lt;P&gt;@Edith Murillo​&amp;nbsp;I think you can use this function: TalendDate.addDate(yourUTC_Date, -7, "HH") to get 7 hours earlier time then yourUTC_Date.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 17:59:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMap-Expression-Function-to-convert-UTC-to-local-time/m-p/2298350#M70830</guid>
      <dc:creator>DataTeam1</dc:creator>
      <dc:date>2020-10-07T17:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: tMap Expression Function to convert UTC to local time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMap-Expression-Function-to-convert-UTC-to-local-time/m-p/2298351#M70831</link>
      <description>&lt;P&gt;Thanks for the reply.  I did get this to work, however, as I was testing the date against the application I came across dates that are difference of -8 instead of -7.  The daylight savings is -7, but how do I incorporate when we're not in daylight savings?  How do I code, IF DAYLIGHT SAVINGS then TalendDate.addDate(yourUTC_Date, -7, "HH")  else TalendDate.addDate(yourUTC_Date, -8, "HH") ?    &lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 22:17:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMap-Expression-Function-to-convert-UTC-to-local-time/m-p/2298351#M70831</guid>
      <dc:creator>Edith1</dc:creator>
      <dc:date>2020-10-07T22:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: tMap Expression Function to convert UTC to local time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMap-Expression-Function-to-convert-UTC-to-local-time/m-p/2298352#M70832</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;that's the reason why the Timezones exist.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Personally I use the "new" Java DateTime classes LocalDate and LocalDateTime, which of course can be converted to a Java "Date" (which Talend uses), because it is much simpler to work with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instance:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ZoneId zoneId = ZoneId.of("UTC") or ZoneId zoneId = ZoneId.of("Europe/Berlin")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;gives you the ZoneId of the corresponding TimeZone and "knows" about the daylight saving time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you take the TimeZones into the date to string conversion, you will get the correct time for this timezone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Exampe:&lt;/P&gt;&lt;P&gt;LocalDateTime localDateTime = LocalDateTime.now(zoneId); //actual time in the defined timeZone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can of course convert ever date or datetime with a zoneId.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;br&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 13:17:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMap-Expression-Function-to-convert-UTC-to-local-time/m-p/2298352#M70832</guid>
      <dc:creator>cadap</dc:creator>
      <dc:date>2020-10-08T13:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: tMap Expression Function to convert UTC to local time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMap-Expression-Function-to-convert-UTC-to-local-time/m-p/2298353#M70833</link>
      <description>&lt;P&gt;Is there a function in tMap to convert the UTC into the local time?&lt;/P&gt;&lt;P&gt;If I format the date as "Z" in tMap, then I get the -0800 or -0700 (timeZone column below) &lt;/P&gt;&lt;P&gt;If I format the date "yyyy-MM-dd HH:mm:ss.SSSXXX", then I get the date and the time zone (convertedDate column)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to use this? Subtract the timeZone from the originalDate to get the local time?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000009ryz3AAA.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131904iC78A6947F94B2F50/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000009ryz3AAA.jpg" alt="0693p000009ryz3AAA.jpg" /&gt;&lt;/span&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 17:36:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMap-Expression-Function-to-convert-UTC-to-local-time/m-p/2298353#M70833</guid>
      <dc:creator>Edith1</dc:creator>
      <dc:date>2020-10-08T17:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: tMap Expression Function to convert UTC to local time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMap-Expression-Function-to-convert-UTC-to-local-time/m-p/2298354#M70834</link>
      <description>&lt;P&gt;There's a solution to do this with tMap date functions! &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TalendDate.parseDateInUTC("yyyy-MM-dd HH:mm:ss", row1.Value )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above expression is converting the originalDate to the newColumn, which is correct according to the time zone. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000009s0czAAA.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/146992i6D1798DF6C1CEFF8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000009s0czAAA.jpg" alt="0693p000009s0czAAA.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 19:11:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMap-Expression-Function-to-convert-UTC-to-local-time/m-p/2298354#M70834</guid>
      <dc:creator>Edith1</dc:creator>
      <dc:date>2020-10-08T19:11:58Z</dc:date>
    </item>
  </channel>
</rss>

