<?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: [resolved] Convert date and empty date in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350716#M117532</link>
    <description>It should be TalendDate.getCurrentDate()</description>
    <pubDate>Fri, 26 Aug 2011 00:32:45 GMT</pubDate>
    <dc:creator>alevy</dc:creator>
    <dc:date>2011-08-26T00:32:45Z</dc:date>
    <item>
      <title>[resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350706#M117522</link>
      <description>Hi,&lt;BR /&gt;I have a problem in a tMap.&lt;BR /&gt;I read a RSS feed with pubdate in GMT or CEST Time.&lt;BR /&gt;My colum table is a DATETIME type.&lt;BR /&gt;1. How to convert GMT to DATETIME ?&lt;BR /&gt;2. CEST is not read by tRSSInput. So, How to insert datetime.now if pubdate is empty ?&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;Regards</description>
      <pubDate>Sat, 16 Nov 2024 12:47:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350706#M117522</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350707#M117523</link>
      <description>Nobody can help me ?</description>
      <pubDate>Wed, 20 Jul 2011 11:46:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350707#M117523</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-20T11:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350708#M117524</link>
      <description>For the empty date I tried this : 
&lt;BR /&gt;(row1.PUBDATE.isEmpty()) 
&lt;BR /&gt;? TalendDate.parseDate("yyyy-MM-dd HH:mm:ss","TalendDate.getCurrentDate()") 
&lt;BR /&gt;:row1.PUBDATE 
&lt;BR /&gt;but don't working 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Wed, 20 Jul 2011 12:34:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350708#M117524</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-20T12:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350709#M117525</link>
      <description>I tried this : 
&lt;BR /&gt;(row1.PUBDATE.isEmpty()) 
&lt;BR /&gt;? TalendDate.parseDate("yyyy-MM-dd HH:mm:ss","2011-07-30 12:51:12") 
&lt;BR /&gt;: new java.util.Date(Long.parseLong(row1.PUBDATE)) 
&lt;BR /&gt;But when the job is on the first GMT date, the error is : 
&lt;BR /&gt;Exception in component tMap_1 
&lt;BR /&gt;java.lang.NumberFormatException: For input string: "20 Jul 2011 11:50:00 GMT" 
&lt;BR /&gt; at java.lang.NumberFormatException.forInputString(Unknown Source) 
&lt;BR /&gt; at java.lang.Long.parseLong(Unknown Source) 
&lt;BR /&gt; at java.lang.Long.parseLong(Unknown Source) 
&lt;BR /&gt; at mediascit.recupflux_0_1.RecupFlux.tMysqlInput_1Process(RecupFlux.java:1246) 
&lt;BR /&gt; at mediascit.recupflux_0_1.RecupFlux.runJobInTOS(RecupFlux.java:1708) 
&lt;BR /&gt; at mediascit.recupflux_0_1.RecupFlux.main(RecupFlux.java:1579) 
&lt;BR /&gt;And : How can I have the currentdate in place of "2011-07-30 12:51:12" ? getCurrentDate don't work 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Wed, 20 Jul 2011 13:02:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350709#M117525</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-20T13:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350710#M117526</link>
      <description>There are a number of problems with your expressions: 
&lt;BR /&gt;1. parseDate converts a String to a Date i.e. the second parameter of parseDate must be a date string as you have correctly used it in your last post. TalendDate.getCurrentDate(), however, already returns a Date so does not need to have parseDate applied to it. 
&lt;BR /&gt;2. In any case, since it is a function, getCurrentDate should not be enclosed in quotes otherwise you are trying to parse an actual String containing the words "TalendDate.getCurrentDate()". 
&lt;BR /&gt;3. If you actually wanted the current date as a String, you could use e.g. TalendDate.getDate("yyyy-MM-dd HH:mm:ss") 
&lt;BR /&gt;4. From the error, it appears that row1.PUBDATE contains the String "20 Jul 2011 11:50:00 GMT", which obviously cannot be parsed to a Long since it is not a whole number. You should simply be parsing it directly to a Date. 
&lt;BR /&gt;i.e. 
&lt;BR /&gt;row1.PUBDATE.isEmpty() 
&lt;BR /&gt;? TalendDate.getCurrentDate() 
&lt;BR /&gt;: TalendDate.parseDate("dd MMM yyyy HH:mm:ss zzz",row1.PUBDATE)</description>
      <pubDate>Thu, 21 Jul 2011 01:48:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350710#M117526</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2011-07-21T01:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350711#M117527</link>
      <description>Hi,&lt;BR /&gt;I resolved my problem last night.&lt;BR /&gt;It's the good solution.&lt;BR /&gt;Thanks.</description>
      <pubDate>Thu, 21 Jul 2011 08:55:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350711#M117527</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-21T08:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350712#M117528</link>
      <description>I discovered a bug :&lt;BR /&gt;My job working in my Studio but don't work in production after publication.&lt;BR /&gt;Error : Data truncation: Incorrect datetime value: '20 Jul 2011 23:00:00 GMT' for column 'date' at row 1&lt;BR /&gt;Error : Data truncation: Incorrect datetime value: '21 Jul 2011 08:37:35 GMT' for column 'date' at row 1&lt;BR /&gt;Error : Data truncation: Incorrect datetime value: '21 Jul 2011 07:18:00 GMT' for column 'date' at row 1&lt;BR /&gt;The database and tables are the same ... &lt;BR /&gt;Any idea ?</description>
      <pubDate>Thu, 21 Jul 2011 10:01:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350712#M117528</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-21T10:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350713#M117529</link>
      <description>It looks like you're trying to pass the original row1.PUBDATE String to the database without parsing it to a Date.</description>
      <pubDate>Thu, 21 Jul 2011 10:05:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350713#M117529</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2011-07-21T10:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350714#M117530</link>
      <description>(row1.PUBDATE.isEmpty())&lt;BR /&gt;? TalendDate.currentDate()&lt;BR /&gt;: TalendDate.parseDate("dd MMM yyyy HH:mm:ss",row1.PUBDATE.substring(0,row1.PUBDATE.indexOf("G")-1))&lt;BR /&gt;The currentDate() return a datetime or a string ???&lt;BR /&gt;My database column is DATETIME format.</description>
      <pubDate>Fri, 22 Jul 2011 10:51:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350714#M117530</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-22T10:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350715#M117531</link>
      <description>Back from holidays ...&lt;BR /&gt;My function :&lt;BR /&gt;(row7.PUBDATE.isEmpty())&lt;BR /&gt;? TalendDate.currentDate()&lt;BR /&gt;: TalendDate.parseDate("dd MMM yyyy HH:mm:ss",row7.PUBDATE.substring(0,row7.PUBDATE.indexOf("G")-1))  &lt;BR /&gt;Error message :&lt;BR /&gt;La méthode currentDate() est indéfinie pour le type TalendDate&lt;BR /&gt;Any idea ?&lt;BR /&gt;Thanks in advance</description>
      <pubDate>Thu, 25 Aug 2011 15:29:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350715#M117531</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-25T15:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350716#M117532</link>
      <description>It should be TalendDate.getCurrentDate()</description>
      <pubDate>Fri, 26 Aug 2011 00:32:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350716#M117532</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2011-08-26T00:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350717#M117533</link>
      <description>Thanks but there is a bug afer few lines :
&lt;BR /&gt;Exception in component tMap_3
&lt;BR /&gt;java.lang.RuntimeException: java.text.ParseException: Unparseable date: "26 Aug 2011 08:06:00"
&lt;BR /&gt; at routines.TalendDate.parseDate(TalendDate.java:503)
&lt;BR /&gt; at mediascit.recupflux_0_1.RecupFlux.tMysqlInput_6Process(RecupFlux.java:2148)
&lt;BR /&gt; at mediascit.recupflux_0_1.RecupFlux.tMysqlInput_5Process(RecupFlux.java:1062)
&lt;BR /&gt; at mediascit.recupflux_0_1.RecupFlux.runJobInTOS(RecupFlux.java:4332)
&lt;BR /&gt; at mediascit.recupflux_0_1.RecupFlux.main(RecupFlux.java:4203)
&lt;BR /&gt;Caused by: java.text.ParseException: Unparseable date: "26 Aug 2011 08:06:00"
&lt;BR /&gt; at java.text.DateFormat.parse(Unknown Source)
&lt;BR /&gt; at routines.TalendDate.parseDate(TalendDate.java:501)
&lt;BR /&gt; ... 4 more</description>
      <pubDate>Fri, 26 Aug 2011 09:33:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350717#M117533</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-26T09:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350718#M117534</link>
      <description>If you're using TalendDate.parseDate("dd MMM yyyy HH:mm:ss","26 Aug 2011 08:06:00") you should not have a problem.  Click on the Code tab at the bottom left of your job-design and find the exact line referred to in the error (2148 from above) to double-check the source of the problem.</description>
      <pubDate>Sat, 27 Aug 2011 06:25:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350718#M117534</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2011-08-27T06:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350719#M117535</link>
      <description>Hi, sorry, don't understood all ...&lt;BR /&gt;I'm going to code tab :&lt;BR /&gt;if (outTMP.source == null) {&lt;BR /&gt;									pstmt_tMysqlOutput_7.setNull(5,&lt;BR /&gt;											java.sql.Types.VARCHAR);&lt;BR /&gt;								} else {&lt;BR /&gt;									pstmt_tMysqlOutput_7.setString(5,&lt;BR /&gt;											outTMP.source);&lt;BR /&gt;								}&lt;BR /&gt;2148 line is outTMP.source);&lt;BR /&gt;So ?</description>
      <pubDate>Sat, 27 Aug 2011 10:45:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350719#M117535</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-27T10:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350720#M117536</link>
      <description>Well, that can't be right. Run the RecupFlux job to make sure you've got the correct line reference and then go to the Code tab again. What version are you using?</description>
      <pubDate>Sat, 27 Aug 2011 12:10:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350720#M117536</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2011-08-27T12:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350721#M117537</link>
      <description>Hi, sorry to be late. Meetings ... 
&lt;BR /&gt;My Version : TIS 4.1.2.r53616 
&lt;BR /&gt;I runed the job again. Error (the same) : 
&lt;BR /&gt; connecting to socket on port 3488 
&lt;BR /&gt; connected 
&lt;BR /&gt;Exception in component tMap_3 
&lt;BR /&gt;java.lang.RuntimeException: java.text.ParseException: Unparseable date: "30 Aug 2011 07:06:00" 
&lt;BR /&gt; at routines.TalendDate.parseDate(TalendDate.java:503) 
&lt;BR /&gt; at mediascit.recupflux_0_1.RecupFlux.tMysqlInput_6Process(RecupFlux.java:2148) 
&lt;BR /&gt; at mediascit.recupflux_0_1.RecupFlux.tMysqlInput_5Process(RecupFlux.java:1062) 
&lt;BR /&gt; at mediascit.recupflux_0_1.RecupFlux.runJobInTOS(RecupFlux.java:4332) 
&lt;BR /&gt; at mediascit.recupflux_0_1.RecupFlux.main(RecupFlux.java:4203) 
&lt;BR /&gt;Caused by: java.text.ParseException: Unparseable date: "30 Aug 2011 07:06:00" 
&lt;BR /&gt; at java.text.DateFormat.parse(Unknown Source) 
&lt;BR /&gt; at routines.TalendDate.parseDate(TalendDate.java:501) 
&lt;BR /&gt; ... 4 more 
&lt;BR /&gt; disconnected 
&lt;BR /&gt;Job RecupFlux terminé à 10:33 30/08/2011. 
&lt;BR /&gt;The code : 
&lt;BR /&gt;outTMP_tmp.date_insertion = (row7.PUBDATE 
&lt;BR /&gt; .isEmpty()) ? TalendDate 
&lt;BR /&gt; .getCurrentDate() 
&lt;BR /&gt; : TalendDate 
&lt;BR /&gt; .parseDate( 
&lt;BR /&gt; "dd MMM yyyy HH:mm:ss", 
&lt;BR /&gt; row7.PUBDATE 
&lt;BR /&gt; .substring( 
&lt;BR /&gt; 0, 
&lt;BR /&gt; row7.PUBDATE 
&lt;BR /&gt; .indexOf("G") - 1)); 
&lt;BR /&gt; outTMP_tmp.id_statut = null; 
&lt;BR /&gt; outTMP_tmp.note = null; 
&lt;BR /&gt; outTMP_tmp.etat = "0"; 
&lt;BR /&gt; outTMP = outTMP_tmp; 
&lt;BR /&gt;The line 2148 is the ".parseDate(</description>
      <pubDate>Tue, 30 Aug 2011 09:36:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350721#M117537</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-30T09:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350722#M117538</link>
      <description>Hi Scots
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;Exception in component tMap_3&lt;BR /&gt;java.lang.RuntimeException: java.text.ParseException: Unparseable date: "30 Aug 2011 07:06:00"&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;It seems you do not come from a English speaking country, try to use the method 
&lt;BR /&gt;TalendDate.parseDateLocale("dd MMM yyyy HH:mm:ss", "30 Aug 2011 07:06:00","EN")
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Tue, 30 Aug 2011 09:45:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350722#M117538</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-30T09:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Convert date and empty date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350723#M117539</link>
      <description>Yes, I'm in France 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Good job Shong, it works 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;I try to publish my job on my server.</description>
      <pubDate>Tue, 30 Aug 2011 10:25:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Convert-date-and-empty-date/m-p/2350723#M117539</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-30T10:25:00Z</dc:date>
    </item>
  </channel>
</rss>

