<?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 tConvertType changes the value of date fields when parsing string in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tConvertType-changes-the-value-of-date-fields-when-parsing/m-p/2259692#M41083</link>
    <description>&lt;B&gt;Environment&lt;/B&gt;: 
&lt;BR /&gt; 
&lt;BR /&gt;Talend Enterprise Big Data (5.4.1.r111943) 
&lt;BR /&gt;jdk 1.6.0_45 
&lt;BR /&gt;Windows 7 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;B&gt;Problem description&lt;/B&gt;: 
&lt;BR /&gt;I'm using the tConvertType component to parse a string from a source database into a Date object. Depending on what data format string I use, the value of the date is changed. 
&lt;BR /&gt;I recreated this issue in a simple job to show the problem in isolation. I've attached the job here as example.zip and screenshots highlighting the important areas as example_screenshots.png. 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBXw.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133349i94A02F032704214C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBXw.png" alt="0683p000009MBXw.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/137836/example.zip_20150908-1933.zip" target="_blank"&gt;example.zip_20150908-1933.zip&lt;/A&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;As shown in example.zip, the input is the string&amp;nbsp;"2014-10-09T14:58:34359699Z" but the output is "2015-11-11T07:19:39" when the format string&amp;nbsp;"yyyy-MM-dd'T'HH:mm:ss" is used.&amp;nbsp; 
&lt;BR /&gt;The field date_2 holds a second copy of the same input string and shows that it is preserved when the format string&amp;nbsp;"yyyy-MM-dd HH:mm:ss" is used.&amp;nbsp; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;B&gt;Secondary issue&lt;/B&gt;:&amp;nbsp; 
&lt;BR /&gt;When the format string "yyyy-MM-dd HH:mm:ss" is used (attempting to work around the problem), strings not matching the format string throw a NumberFormatException. For example, for the string "string", Talend attempts to parse the first 4 characters "stri" as the year. The result is the message below (table from a tLogRow attached to the tConvertType rejects output). &amp;nbsp;This seems inconsistent with the behaviour I've seen before where the row would be sent to rejects without raising an unhandled exception. 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;&lt;FONT color="#99ccff"&gt;java.lang.NumberFormatException: For input string: "stri"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at java.lang.Integer.parseInt(Integer.java:449)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at java.lang.Integer.parseInt(Integer.java:499)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at routines.system.FastDateParser$DateTimeParser.parse(FastDateParser.java:206)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at java.text.DateFormat.parse(DateFormat.java:335)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at routines.TalendDate.parseDate(TalendDate.java:809)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at routines.system.TypeConvert.String2Date(TypeConvert.java:4117)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at pdwserver.test_brokendateformat_0_1.test_brokenDateFormat.tFixedFlowInput_1Process(test_brokenDateFormat.java:1190)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at pdwserver.test_brokendateformat_0_1.test_brokenDateFormat.runJobInTOS(test_brokenDateFormat.java:1724)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at pdwserver.test_brokendateformat_0_1.test_brokenDateFormat.main(test_brokenDateFormat.java:1589)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;.--------------------------------------------------------------------------------------.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;| &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#1. tLogRow_2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;+--------------+-----------------------------------------------------------------------+&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;| key &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| value &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;+--------------+-----------------------------------------------------------------------+&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;| date &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | 2015-11-11T07:19:39 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;| date_2 &amp;nbsp; &amp;nbsp; &amp;nbsp; | null &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;| errorCode &amp;nbsp; &amp;nbsp;| 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;| errorMessage | date_2:java.text.ParseException: Unparseable date: "string" - Line: 0 |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;+--------------+-----------------------------------------------------------------------+&lt;/FONT&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 16 Nov 2024 11:03:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T11:03:28Z</dc:date>
    <item>
      <title>tConvertType changes the value of date fields when parsing string</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tConvertType-changes-the-value-of-date-fields-when-parsing/m-p/2259692#M41083</link>
      <description>&lt;B&gt;Environment&lt;/B&gt;: 
&lt;BR /&gt; 
&lt;BR /&gt;Talend Enterprise Big Data (5.4.1.r111943) 
&lt;BR /&gt;jdk 1.6.0_45 
&lt;BR /&gt;Windows 7 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;B&gt;Problem description&lt;/B&gt;: 
&lt;BR /&gt;I'm using the tConvertType component to parse a string from a source database into a Date object. Depending on what data format string I use, the value of the date is changed. 
&lt;BR /&gt;I recreated this issue in a simple job to show the problem in isolation. I've attached the job here as example.zip and screenshots highlighting the important areas as example_screenshots.png. 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBXw.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133349i94A02F032704214C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBXw.png" alt="0683p000009MBXw.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/137836/example.zip_20150908-1933.zip" target="_blank"&gt;example.zip_20150908-1933.zip&lt;/A&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;As shown in example.zip, the input is the string&amp;nbsp;"2014-10-09T14:58:34359699Z" but the output is "2015-11-11T07:19:39" when the format string&amp;nbsp;"yyyy-MM-dd'T'HH:mm:ss" is used.&amp;nbsp; 
&lt;BR /&gt;The field date_2 holds a second copy of the same input string and shows that it is preserved when the format string&amp;nbsp;"yyyy-MM-dd HH:mm:ss" is used.&amp;nbsp; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;B&gt;Secondary issue&lt;/B&gt;:&amp;nbsp; 
&lt;BR /&gt;When the format string "yyyy-MM-dd HH:mm:ss" is used (attempting to work around the problem), strings not matching the format string throw a NumberFormatException. For example, for the string "string", Talend attempts to parse the first 4 characters "stri" as the year. The result is the message below (table from a tLogRow attached to the tConvertType rejects output). &amp;nbsp;This seems inconsistent with the behaviour I've seen before where the row would be sent to rejects without raising an unhandled exception. 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;&lt;FONT color="#99ccff"&gt;java.lang.NumberFormatException: For input string: "stri"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at java.lang.Integer.parseInt(Integer.java:449)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at java.lang.Integer.parseInt(Integer.java:499)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at routines.system.FastDateParser$DateTimeParser.parse(FastDateParser.java:206)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at java.text.DateFormat.parse(DateFormat.java:335)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at routines.TalendDate.parseDate(TalendDate.java:809)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at routines.system.TypeConvert.String2Date(TypeConvert.java:4117)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at pdwserver.test_brokendateformat_0_1.test_brokenDateFormat.tFixedFlowInput_1Process(test_brokenDateFormat.java:1190)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at pdwserver.test_brokendateformat_0_1.test_brokenDateFormat.runJobInTOS(test_brokenDateFormat.java:1724)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;	at pdwserver.test_brokendateformat_0_1.test_brokenDateFormat.main(test_brokenDateFormat.java:1589)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;.--------------------------------------------------------------------------------------.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;| &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#1. tLogRow_2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;+--------------+-----------------------------------------------------------------------+&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;| key &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| value &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;+--------------+-----------------------------------------------------------------------+&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;| date &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | 2015-11-11T07:19:39 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;| date_2 &amp;nbsp; &amp;nbsp; &amp;nbsp; | null &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;| errorCode &amp;nbsp; &amp;nbsp;| 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;| errorMessage | date_2:java.text.ParseException: Unparseable date: "string" - Line: 0 |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#99ccff"&gt;+--------------+-----------------------------------------------------------------------+&lt;/FONT&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Nov 2024 11:03:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tConvertType-changes-the-value-of-date-fields-when-parsing/m-p/2259692#M41083</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T11:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: tConvertType changes the value of date fields when parsing string</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tConvertType-changes-the-value-of-date-fields-when-parsing/m-p/2259693#M41084</link>
      <description>Hi,
&lt;BR /&gt;Java does not support six and only support the millisecond sss.
&lt;BR /&gt;If you want to show six, write SSSSSS and the other will be Auto completed with&amp;nbsp; "000".
&lt;BR /&gt;For example, the input is:
&lt;BR /&gt;17-APR-12 07.42.57.811804 AM
&lt;BR /&gt;output:
&lt;BR /&gt;17-APR-12 07.42.57.811000 AM
&lt;BR /&gt;
&lt;BR /&gt;Best regards
&lt;BR /&gt;Sabrina</description>
      <pubDate>Wed, 16 Sep 2015 08:58:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tConvertType-changes-the-value-of-date-fields-when-parsing/m-p/2259693#M41084</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-09-16T08:58:13Z</dc:date>
    </item>
  </channel>
</rss>

