<?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: CHANGE DATE FORMAT WITH BLANK ROWS in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/CHANGE-DATE-FORMAT-WITH-BLANK-ROWS/m-p/2257125#M39304</link>
    <description>&lt;P&gt;I'm glad that works, but that will not change the format, that converts your Sting into a Date. I suspect your output column is a Date type and by default has the correct String output format. It is important to recognise the difference here &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Sep 2019 16:23:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-09-23T16:23:32Z</dc:date>
    <item>
      <title>CHANGE DATE FORMAT WITH BLANK ROWS</title>
      <link>https://community.qlik.com/t5/Talend-Studio/CHANGE-DATE-FORMAT-WITH-BLANK-ROWS/m-p/2257120#M39299</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to convert a string that acts as an input with date format&amp;nbsp;"EEE MMM dd HH:mm:ss Z yyyy" into the format&amp;nbsp;"dd/MM/yyyy", avoiding the existing blank rows.&amp;nbsp; I found the following command to do it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TalendDate.isDate(row1.Fecha_de_Llegada_Real,"EEE MMM dd HH:mm:ss Z yyyy")? TalendDate.parseDate("dd/MM/yyyy",row1.Fecha_de_Llegada_Real) : null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Although I am 100% sure this is the correct input format, as when printing this row as a string I obtain strings like "Wed Jan 02 00:00:00 CET 2019", I get all null because all the values of the TalendDate.isDate() give a false value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea why this is heppening?&lt;/P&gt;&lt;P&gt;Thank you so much&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 09:57:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/CHANGE-DATE-FORMAT-WITH-BLANK-ROWS/m-p/2257120#M39299</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-23T09:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: CHANGE DATE FORMAT WITH BLANK ROWS</title>
      <link>https://community.qlik.com/t5/Talend-Studio/CHANGE-DATE-FORMAT-WITH-BLANK-ROWS/m-p/2257121#M39300</link>
      <description>&lt;P&gt;There were a couple of issues in this. The way to get what you want is shown below....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;TalendDate.isDate(&lt;SPAN&gt;row1.Fecha_de_Llegada_Real&lt;/SPAN&gt;,"EEE MMM dd HH:mm:ss z yyyy")? TalendDate.formatDate("dd/MM/yyyy", TalendDate.parseDate("EEE MMM dd HH:mm:ss z yyyy",&lt;SPAN&gt;row1.Fecha_de_Llegada_Real&lt;/SPAN&gt;)) : null&lt;/PRE&gt;
&lt;P&gt;The first error was the format. You used Z instead of z.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There was another omission though. In order to change the output format, you need to first convert the String to a Date. THEN you can format it to "dd/MM/yyyy".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above code should work for you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 13:43:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/CHANGE-DATE-FORMAT-WITH-BLANK-ROWS/m-p/2257121#M39300</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-23T13:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: CHANGE DATE FORMAT WITH BLANK ROWS</title>
      <link>https://community.qlik.com/t5/Talend-Studio/CHANGE-DATE-FORMAT-WITH-BLANK-ROWS/m-p/2257122#M39301</link>
      <description>&lt;P&gt;Thanks for the reply. You are right when changing the output format.&lt;/P&gt; 
&lt;P&gt;Unfortunately, the first change didn't work as expected. Changing the capital z did not make any change to the result of getting all false. Actually, I found some strange error when trying to parse the date as when using:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;TalendDate.parseDateLocale("EEE MMM dd HH:mm:ss z yyyy",row1.Fecha_de_Llegada_Real,"EN"), it works perfectly until it finds a null, obviously showing a NullPointerException, while using:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;TalendDate.parseDate("EEE MMM dd HH:mm:ss z yyyy",row1.Fecha_de_Llegada_Real), it says that it is an Unparseable date, and&amp;nbsp;using&amp;nbsp;your proposed expression:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;TalendDate.formatDate("dd/MM/yyyy", TalendDate.parseDate(&lt;BR /&gt;"EEE MMM dd HH:mm:ss z yyyy", row1.Fecha_de_Llegada_Real)), it&lt;/P&gt; 
&lt;P&gt;appears a mismatch error saying that "cannot convert from String to Date", I guess as a consequence of the previous error.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I know it does not make sense, that's why my confusion.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 15:01:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/CHANGE-DATE-FORMAT-WITH-BLANK-ROWS/m-p/2257122#M39301</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-23T15:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: CHANGE DATE FORMAT WITH BLANK ROWS</title>
      <link>https://community.qlik.com/t5/Talend-Studio/CHANGE-DATE-FORMAT-WITH-BLANK-ROWS/m-p/2257123#M39302</link>
      <description>&lt;P&gt;Ah, I see. Sorry I neglected to include a check for a null input. You need to use this....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;row1.Fecha_de_Llegada_Real!=null ?(TalendDate.isDate(row1.Fecha_de_Llegada_Real,"EEE MMM dd HH:mm:ss z yyyy")? TalendDate.formatDate("dd/MM/yyyy", TalendDate.parseDate("EEE MMM dd HH:mm:ss z yyyy",row1.Fecha_de_Llegada_Real)) : null) : null&lt;/PRE&gt;
&lt;P&gt;I've simply added a check for the input value (or lack of). If your data comes in as null, you cannot perform String to Date conversion since null is nothing (not a String). The above should work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Z to z is the difference between.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="0" summary="Chart shows pattern letters, date/time component, presentation, and examples." cellspacing="3" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR bgcolor="#eeeeff"&gt;
&lt;TD&gt;&lt;CODE&gt;z&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;Time zone&lt;/TD&gt;
&lt;TD&gt;&lt;A href="https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html#timezone" target="_blank" rel="nofollow noopener noreferrer"&gt;General time zone&lt;/A&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;CODE&gt;Pacific Standard Time&lt;/CODE&gt;;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;PST&lt;/CODE&gt;;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;GMT-08:00&lt;/CODE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;CODE&gt;Z&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;Time zone&lt;/TD&gt;
&lt;TD&gt;&lt;A href="https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html#rfc822timezone" target="_blank" rel="nofollow noopener noreferrer"&gt;RFC 822 time zone&lt;/A&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;CODE&gt;-0800&lt;/CODE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 15:52:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/CHANGE-DATE-FORMAT-WITH-BLANK-ROWS/m-p/2257123#M39302</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-23T15:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: CHANGE DATE FORMAT WITH BLANK ROWS</title>
      <link>https://community.qlik.com/t5/Talend-Studio/CHANGE-DATE-FORMAT-WITH-BLANK-ROWS/m-p/2257124#M39303</link>
      <description>&lt;P&gt;In the end it was easier than what we thought, but thanks to the beginning of your last code was the key, as by using:&lt;/P&gt;
&lt;P&gt;row1.Fecha_de_Llegada_Real!=null ? TalendDate.parseDateLocale("EEE MMM dd HH:mm:ss z yyyy",row1.Fecha_de_Llegada_Real,"EN") : null, worked perfectly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 16:19:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/CHANGE-DATE-FORMAT-WITH-BLANK-ROWS/m-p/2257124#M39303</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-23T16:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: CHANGE DATE FORMAT WITH BLANK ROWS</title>
      <link>https://community.qlik.com/t5/Talend-Studio/CHANGE-DATE-FORMAT-WITH-BLANK-ROWS/m-p/2257125#M39304</link>
      <description>&lt;P&gt;I'm glad that works, but that will not change the format, that converts your Sting into a Date. I suspect your output column is a Date type and by default has the correct String output format. It is important to recognise the difference here &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 16:23:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/CHANGE-DATE-FORMAT-WITH-BLANK-ROWS/m-p/2257125#M39304</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-23T16:23:32Z</dc:date>
    </item>
  </channel>
</rss>

