<?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 Date problem - add year in formatDate in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Date-problem-add-year-in-formatDate/m-p/2234196#M23637</link>
    <description>&lt;P&gt;hi everyone, I have a problem with a date.&lt;BR /&gt;i have a date variable taken from a database field for use in a query in another database.&lt;BR /&gt;If I print the variable I see "Mon Dec 30 12:33:35 CET 2019" but I have to transform it into the type "dd / MM / YYYY" then I transform it through "TalendDate.formatDate (" dd / MM / YYYY ", context.LastDate) .&lt;BR /&gt;The problem that adds a year to the date displaying "12/30/2020" and not "12/30/2019".&lt;BR /&gt;If the variable is valued at 29/12/2019 until 23:59 all works correctly, while from 30/12 Talend adds one year.&lt;BR /&gt;Can someone help me? is it a bug?&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 03:42:19 GMT</pubDate>
    <dc:creator>Gabri11</dc:creator>
    <dc:date>2024-11-16T03:42:19Z</dc:date>
    <item>
      <title>Date problem - add year in formatDate</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-problem-add-year-in-formatDate/m-p/2234196#M23637</link>
      <description>&lt;P&gt;hi everyone, I have a problem with a date.&lt;BR /&gt;i have a date variable taken from a database field for use in a query in another database.&lt;BR /&gt;If I print the variable I see "Mon Dec 30 12:33:35 CET 2019" but I have to transform it into the type "dd / MM / YYYY" then I transform it through "TalendDate.formatDate (" dd / MM / YYYY ", context.LastDate) .&lt;BR /&gt;The problem that adds a year to the date displaying "12/30/2020" and not "12/30/2019".&lt;BR /&gt;If the variable is valued at 29/12/2019 until 23:59 all works correctly, while from 30/12 Talend adds one year.&lt;BR /&gt;Can someone help me? is it a bug?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:42:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-problem-add-year-in-formatDate/m-p/2234196#M23637</guid>
      <dc:creator>Gabri11</dc:creator>
      <dc:date>2024-11-16T03:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Date problem - add year in formatDate</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-problem-add-year-in-formatDate/m-p/2234197#M23638</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Not sure to understand all you are saying, but basically :&lt;/P&gt; 
&lt;UL&gt; 
 &lt;LI&gt;A "Date" in Talend, like in nearly any DBMS is associated with a timestamp precise to the millisecond&lt;/LI&gt; 
 &lt;LI&gt;You can select a "preferred format" for displaying it in the column dedicated&lt;/LI&gt; 
 &lt;LI&gt;To properly print it as you wish, you need to use TalendDate.formatDate&lt;/LI&gt; 
&lt;/UL&gt; 
&lt;P&gt;Going with that, just take your date and put these components :&lt;/P&gt; 
&lt;P&gt;Input =&amp;gt;tMap=&amp;gt;tLogRow in Table mode&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The input is you date.&lt;/P&gt; 
&lt;P&gt;In the tMap, create 2 columns :&lt;/P&gt; 
&lt;OL&gt; 
 &lt;LI&gt;The date with a specified format&lt;/LI&gt; 
 &lt;LI&gt;A string formatting your date&lt;/LI&gt; 
&lt;/OL&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If you can show us your tMap and the result we could help you.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Sincerely,&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2019 18:34:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-problem-add-year-in-formatDate/m-p/2234197#M23638</guid>
      <dc:creator>rmartin2</dc:creator>
      <dc:date>2019-12-30T18:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Date problem - add year in formatDate</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-problem-add-year-in-formatDate/m-p/2234198#M23639</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LLGkAAO"&gt;@gabrig11&lt;/A&gt;&amp;nbsp;,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I figured it out while debugging one of colleague job !&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;U&gt;Short version :&lt;/U&gt;&lt;BR /&gt;Never use "YYYY" but "yyyy". "YYYY" is ISO year, and "yyyy" is calendar year. In database it's often written "IYYY".&lt;BR /&gt;&lt;BR /&gt;&lt;U&gt;Long version :&lt;/U&gt;&lt;/P&gt; 
&lt;P&gt;When using weeks, you have to decide to which year it belong. For this year, we had Monday and Tuesday in 2019 and the other day in 2020. In ISO norm, the week belong to the year owning the Thursday (on simpler, the one that has the greatest number of days of this week).&lt;/P&gt; 
&lt;P&gt;So technically, in ISO standard, 30th December 2019 is 1st day of 1st week of 2020. So the ISO year is 2020, not 2019.&lt;/P&gt; 
&lt;P&gt;Same for 31th.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Long story short : unless you are querying with weeks, &lt;U&gt;you should never use "YYYY"&lt;/U&gt;. Always use "yyyy".&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Sincerely,&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 16:15:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-problem-add-year-in-formatDate/m-p/2234198#M23639</guid>
      <dc:creator>rmartin2</dc:creator>
      <dc:date>2020-01-02T16:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Date problem - add year in formatDate</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-problem-add-year-in-formatDate/m-p/2234199#M23640</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;I got the same error when you are trying the implicit conversion where I am trying to parse the input value directly to output column in target dd/MM/yyyy format. I believe the time zone value of +1 is getting added to year. I would recommend to create a JIRA ticket for the same using below link.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://jira.talendforge.org/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://jira.talendforge.org/&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;A quick work around will be as shown below where we are allowing the date value to be stored to an intermediate layer and its giving correct result.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 722px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8xE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142718i6CD511581C921956/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8xE.png" alt="0683p000009M8xE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&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="0683p000009M8xs.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132316i0344D8B8DCB109F7/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8xs.png" alt="0683p000009M8xs.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 16:25:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-problem-add-year-in-formatDate/m-p/2234199#M23640</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-02T16:25:59Z</dc:date>
    </item>
  </channel>
</rss>

