<?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: Wrong result for difference between two dates. in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Wrong-result-for-difference-between-two-dates/m-p/2327590#M96959</link>
    <description>There is an undocumented parameter to diffDate to handle this. Set ignoreDST as appropriate.
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;PRE&gt;public static long diffDate(Date date1, Date date2, String dateType, boolean ignoreDST)&lt;BR /&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 12 Jan 2016 08:45:40 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-01-12T08:45:40Z</dc:date>
    <item>
      <title>Wrong result for difference between two dates.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Wrong-result-for-difference-between-two-dates/m-p/2327585#M96954</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I have a scenario, in which I should be calculating the difference between two dates (date format MM-dd-yyyy).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I tried doing this using&amp;nbsp;TalendDate.diffDate(Date1 ,Date2), but I am getting different results for different dates.&amp;nbsp;&lt;BR /&gt;For Example: TalendDate.diffDate("12-31-2015 ,"12-01-2015") the result is 30(correct), but for TalendDate.diffDate("03-31-2015 ,"03-01-2015") the result is 29 (wrong), similarly for some other dates. The results should be long or integer.&lt;BR /&gt;&lt;BR /&gt;In the job I designed, the start and end dates are calculated in the job itself based on other dates in some cases and in some cases, we extract dates from database. Both the cases the issue is same.&lt;BR /&gt;&lt;BR /&gt;I tried few other solutions which were provided in the forum, but it didn't help me.&lt;BR /&gt;&lt;BR /&gt;Please help me out.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Bharath&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2016 21:33:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Wrong-result-for-difference-between-two-dates/m-p/2327585#M96954</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-06T21:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong result for difference between two dates.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Wrong-result-for-difference-between-two-dates/m-p/2327586#M96955</link>
      <description>As you're passing Strings, you're depending on default formats and may be falling foul of Java's Lenient Date Parsing. 
&lt;BR /&gt;Have you tried passing the date format as a parameter, or converting to Date type first?</description>
      <pubDate>Thu, 07 Jan 2016 08:21:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Wrong-result-for-difference-between-two-dates/m-p/2327586#M96955</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-07T08:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong result for difference between two dates.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Wrong-result-for-difference-between-two-dates/m-p/2327587#M96956</link>
      <description>Hello, 
&lt;BR /&gt;I tried with TalendDate.diffDateIgnoreDST and the result seems to be ok for your examples. 
&lt;BR /&gt; 
&lt;B&gt;DST means Daylight saving time&lt;/B&gt;. 
&lt;BR /&gt;If you want to know more about it, Google is your friend. 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;I hope it helps you.</description>
      <pubDate>Thu, 07 Jan 2016 09:08:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Wrong-result-for-difference-between-two-dates/m-p/2327587#M96956</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-07T09:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong result for difference between two dates.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Wrong-result-for-difference-between-two-dates/m-p/2327588#M96957</link>
      <description>Hi Tdz,&lt;BR /&gt;Thanks for the help. It worked!!&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Bharath</description>
      <pubDate>Mon, 11 Jan 2016 22:05:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Wrong-result-for-difference-between-two-dates/m-p/2327588#M96957</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-11T22:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong result for difference between two dates.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Wrong-result-for-difference-between-two-dates/m-p/2327589#M96958</link>
      <description>Hello Bharath, 
&lt;BR /&gt;You're welcome. 
&lt;BR /&gt;You can mark this post as "resolved". 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Tue, 12 Jan 2016 08:09:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Wrong-result-for-difference-between-two-dates/m-p/2327589#M96958</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-12T08:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong result for difference between two dates.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Wrong-result-for-difference-between-two-dates/m-p/2327590#M96959</link>
      <description>There is an undocumented parameter to diffDate to handle this. Set ignoreDST as appropriate.
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;PRE&gt;public static long diffDate(Date date1, Date date2, String dateType, boolean ignoreDST)&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Jan 2016 08:45:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Wrong-result-for-difference-between-two-dates/m-p/2327590#M96959</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-12T08:45:40Z</dc:date>
    </item>
  </channel>
</rss>

