<?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: How to convert a string to a date. in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-convert-a-string-to-a-date/m-p/2345126#M112701</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;If you are trying to  convert UTC time to local time, please take a look at this &lt;A href="https://community.talend.com/s/feed/0D53p000086xpyaCAA" alt="https://community.talend.com/s/feed/0D53p000086xpyaCAA" target="_blank"&gt;topic &lt;/A&gt;and try the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if it works. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 May 2021 09:15:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-05-28T09:15:39Z</dc:date>
    <item>
      <title>How to convert a string to a date.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-convert-a-string-to-a-date/m-p/2345123#M112698</link>
      <description>&lt;P&gt;I have strings in the following formats that I would like to convert into a date.&lt;/P&gt;&lt;P&gt;2021-05-21T11:45:15Z&lt;/P&gt;&lt;P&gt;2021-05-25T18:59:27.513Z&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried tMap with the following with no luck.&lt;/P&gt;&lt;P&gt;TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",row7.created_at);&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exception in component tXMLMap_1 (w_xpath_bu_testdev_wDB_dateformat)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;java.lang.RuntimeException: java.text.ParseException: Unparseable date: "2021-05-25T20:23:27Z"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:07:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-convert-a-string-to-a-date/m-p/2345123#M112698</guid>
      <dc:creator>RVeitch_84</dc:creator>
      <dc:date>2024-11-16T00:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a string to a date.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-convert-a-string-to-a-date/m-p/2345124#M112699</link>
      <description>&lt;P&gt;It seems the data has different date format, you can check the length of string first, and then use corresponding date pattern to parse the string and convert it to Date. eg:&lt;/P&gt;&lt;P&gt;row7.created_at.length()&amp;gt;20?TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",row7.created_at):TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss'Z'",row7.created_at);&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 03:45:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-convert-a-string-to-a-date/m-p/2345124#M112699</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-26T03:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a string to a date.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-convert-a-string-to-a-date/m-p/2345125#M112700</link>
      <description>&lt;P&gt;Another question, how can I convert that parsed date into local time from:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;I&gt;row7.created_at.length()&amp;gt;20?TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",row7.created_at):TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss'Z'",row7.created_at);&amp;nbsp;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2020-09-27T22:34:03Z this is what I'm getting&lt;/P&gt;&lt;P&gt;2020-09-27 17:34:03 But I need it in this format?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was thinking of doing something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000F8ywBAAR.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152499iEF128D0327912F3E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000F8ywBAAR.jpg" alt="0695b00000F8ywBAAR.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000F8ywzAAB.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156429i94796742F41D2813/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000F8ywzAAB.jpg" alt="0695b00000F8ywzAAB.jpg" /&gt;&lt;/span&gt;﻿&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000F8yxEAAR.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138428i936559846367EBD4/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000F8yxEAAR.jpg" alt="0695b00000F8yxEAAR.jpg" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 19:07:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-convert-a-string-to-a-date/m-p/2345125#M112700</guid>
      <dc:creator>RVeitch_84</dc:creator>
      <dc:date>2021-05-26T19:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a string to a date.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-convert-a-string-to-a-date/m-p/2345126#M112701</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;If you are trying to  convert UTC time to local time, please take a look at this &lt;A href="https://community.talend.com/s/feed/0D53p000086xpyaCAA" alt="https://community.talend.com/s/feed/0D53p000086xpyaCAA" target="_blank"&gt;topic &lt;/A&gt;and try the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if it works. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 09:15:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-convert-a-string-to-a-date/m-p/2345126#M112701</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-28T09:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a string to a date.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-convert-a-string-to-a-date/m-p/2345127#M112702</link>
      <description>&lt;P&gt;Thanks I ended up doing that same thing, see my example:&lt;/P&gt;&lt;P&gt;I had to add the option to look for a Null first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;I&gt;Relational.NOT(Relational.ISNULL(row4.created_at1))?row4.created_at1.length()&amp;gt;20?TalendDate.parseDateInUTC("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",row4.created_at1):TalendDate.parseDateInUTC("yyyy-MM-dd'T'HH:mm:ss'Z'",row4.created_at1):TalendDate.parseDateInUTC("yyyy-MM-dd","0000-00-00");&amp;nbsp;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 12:05:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-convert-a-string-to-a-date/m-p/2345127#M112702</guid>
      <dc:creator>RVeitch_84</dc:creator>
      <dc:date>2021-05-28T12:05:16Z</dc:date>
    </item>
  </channel>
</rss>

