<?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 tMap in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-convert-a-String-to-a-Date-in-tMap/m-p/2249381#M33937</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; Please refer the below details to convert the data to correct date. I am generating a test string as mentioned in your post "*3/12/2018". First I am doing the cleansing activity using java function and after that I am formatting it to right way.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 911px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M17z.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/127868iD5EAD6FD7FF38D98/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M17z.png" alt="0683p000009M17z.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M17g.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154028i33F7772AFABF1071/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M17g.png" alt="0683p000009M17g.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The code to be used is as shown below.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;Relational.ISNULL(row1.input)?null:(TalendDate.parseDate("MM/dd/yyyy",row1.input.replaceAll("\\*", "0")))&amp;nbsp;&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If the details has helped you, could you please mark the topic as resolved? Kudos are also welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Nikhil Thampi&lt;/P&gt;</description>
    <pubDate>Thu, 15 Nov 2018 05:10:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-11-15T05:10:24Z</dc:date>
    <item>
      <title>How to convert a String to a Date in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-convert-a-String-to-a-Date-in-tMap/m-p/2249380#M33936</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have an excel file with a date column.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The&amp;nbsp;column is defined in excel as a date with a format of '*3/12/2018'. I&amp;nbsp; have changed my schema in talend for&lt;SPAN&gt;&amp;nbsp;this column to be a string.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;The column can contain nulls in excel.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;I have tried so many options an continuously get errors.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I want to convert the date string (with mm/dd/yyyy) to the same format but as a date for the output Postgres table.&lt;/P&gt; 
&lt;P&gt;I am using the following expression:&lt;/P&gt; 
&lt;P&gt;(StringHandling.LEN(row1.open_item_date) &amp;lt;1)? null :&lt;BR /&gt;TalendDate.parseDateLocale("EEE MMM DD HH:mm:ss zzz yyyy", row1.open_item_date,"EN");&lt;/P&gt; 
&lt;P&gt;This returns:&amp;nbsp;"2017-01-20 00:00:00.000000 -06:00:00"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;When i use anything else i get an error.&amp;nbsp; Could you please help as all i want is the mm/dd/yyyy format as my output.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 19:13:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-convert-a-String-to-a-Date-in-tMap/m-p/2249380#M33936</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-14T19:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a String to a Date in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-convert-a-String-to-a-Date-in-tMap/m-p/2249381#M33937</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; Please refer the below details to convert the data to correct date. I am generating a test string as mentioned in your post "*3/12/2018". First I am doing the cleansing activity using java function and after that I am formatting it to right way.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 911px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M17z.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/127868iD5EAD6FD7FF38D98/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M17z.png" alt="0683p000009M17z.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M17g.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154028i33F7772AFABF1071/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M17g.png" alt="0683p000009M17g.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The code to be used is as shown below.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;Relational.ISNULL(row1.input)?null:(TalendDate.parseDate("MM/dd/yyyy",row1.input.replaceAll("\\*", "0")))&amp;nbsp;&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If the details has helped you, could you please mark the topic as resolved? Kudos are also welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Nikhil Thampi&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 05:10:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-convert-a-String-to-a-Date-in-tMap/m-p/2249381#M33937</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-15T05:10:24Z</dc:date>
    </item>
  </channel>
</rss>

