<?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: Daylight saving time in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359860#M124565</link>
    <description>Hi&lt;BR /&gt;Sorry. I may misunderstood this.&lt;BR /&gt;I type in tJava as follow.&lt;BR /&gt;&lt;PRE&gt;Date dateend=TalendDate.parseDate("yyyy-MM-dd HH:mm:ss", "2012-03-26 00:00:00");&lt;BR /&gt;Date datestart=TalendDate.parseDate("yyyy-MM-dd HH:mm:ss", "2012-03-25 00:00:00");&lt;BR /&gt;long test=TalendDate.diffDate(datestart, dateend,"ss");&lt;BR /&gt;System.out.println(test);&lt;/PRE&gt;&lt;BR /&gt;The return value is -86400...&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro</description>
    <pubDate>Thu, 22 Mar 2012 05:44:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-03-22T05:44:36Z</dc:date>
    <item>
      <title>Daylight saving time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359859#M124564</link>
      <description>Hi everybody,
&lt;BR /&gt;as you may know, we change time this sunday (+1 hour). This causes me trouble cause I am working with dates (and especially diffDate). The problem is the following:
&lt;BR /&gt;
&lt;PRE&gt;dateend=TalendDate.parseDate("yyyy-MM-dd HH:mm:ss", "2012-03-26 00:00:00");&lt;BR /&gt;datestart=TalendDate.parseDate("yyyy-MM-dd HH:mm:ss", "2012-03-25 00:00:00");&lt;BR /&gt;row1.test=TalendDate.diffDate(datestart, dateend,"ss");&lt;BR /&gt;//will return -82800 (86400 seconds - 3600)&lt;/PRE&gt;
&lt;BR /&gt;whereas:
&lt;BR /&gt;
&lt;PRE&gt;dateend=TalendDate.parseDate("yyyy-MM-dd HH:mm:ss", "2012-03-27 00:00:00");&lt;BR /&gt;datestart=TalendDate.parseDate("yyyy-MM-dd HH:mm:ss", "2012-03-26 00:00:00");&lt;BR /&gt;row1.test=TalendDate.diffDate(datestart, dateend,"ss");&lt;BR /&gt;//will return 86400 seconds&lt;/PRE&gt;
&lt;BR /&gt;So I try to develop a routine to have a corrected date. The idea is to add one hour if the day is a sunlight saving one:
&lt;BR /&gt;
&lt;PRE&gt;package routines;&lt;BR /&gt;import java.util.Date;&lt;BR /&gt;import routines.TalendDate;&lt;BR /&gt;public class CustomOperations {&lt;BR /&gt;    public static Date correctTimeOffset(Date stupidDate)&lt;BR /&gt;    	{&lt;BR /&gt;    		Date stupidDateMinusOne;&lt;BR /&gt;    		Date correctedDate;&lt;BR /&gt;    		&lt;BR /&gt;    		correctedDate=stupidDate;&lt;BR /&gt;    		stupidDateMinusOne=TalendDate.addDate(stupidDate, -1, "dd");&lt;BR /&gt;    		&lt;BR /&gt;    		if ( Math.abs(TalendDate.diffDate(stupidDate, stupidDateMinusOne))&amp;lt;86400 )&lt;BR /&gt;    			{&lt;BR /&gt;    				correctedDate=TalendDate.addDate(stupidDate, 1, "hh");&lt;BR /&gt;    			}&lt;BR /&gt;    		return correctedDate;&lt;BR /&gt;        }&lt;/PRE&gt;
&lt;BR /&gt;but it does not work (problems with types). Any idea ?
&lt;BR /&gt;Still, I do not know whether it is the right way to proceed: I fear that if I add 1 hour to the day, it will return the following day... no ?</description>
      <pubDate>Wed, 21 Mar 2012 18:36:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359859#M124564</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-21T18:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Daylight saving time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359860#M124565</link>
      <description>Hi&lt;BR /&gt;Sorry. I may misunderstood this.&lt;BR /&gt;I type in tJava as follow.&lt;BR /&gt;&lt;PRE&gt;Date dateend=TalendDate.parseDate("yyyy-MM-dd HH:mm:ss", "2012-03-26 00:00:00");&lt;BR /&gt;Date datestart=TalendDate.parseDate("yyyy-MM-dd HH:mm:ss", "2012-03-25 00:00:00");&lt;BR /&gt;long test=TalendDate.diffDate(datestart, dateend,"ss");&lt;BR /&gt;System.out.println(test);&lt;/PRE&gt;&lt;BR /&gt;The return value is -86400...&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro</description>
      <pubDate>Thu, 22 Mar 2012 05:44:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359860#M124565</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-22T05:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Daylight saving time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359861#M124566</link>
      <description>Hi Pedro,&lt;BR /&gt;I copied/paste your code in a tJava component in my installation. Result is really -82800... Bug ?&lt;BR /&gt;do you think this comes from a locale environment setting ? I am using version 5.0.2, Build id: r78327-20120216-0244&lt;BR /&gt;thanks !&lt;BR /&gt;laloune</description>
      <pubDate>Thu, 22 Mar 2012 07:01:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359861#M124566</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-22T07:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Daylight saving time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359862#M124567</link>
      <description>Hi&lt;BR /&gt;I have tested this both in TOS 5.0.1 and TOS 5.0.2.&lt;BR /&gt;The result is as follow.&lt;BR /&gt;I didn't encounter this issue before...&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro</description>
      <pubDate>Thu, 22 Mar 2012 07:07:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359862#M124567</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-22T07:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Daylight saving time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359863#M124568</link>
      <description>wtf ?&lt;BR /&gt;where are you located ? which locale is your system set on ?</description>
      <pubDate>Thu, 22 Mar 2012 07:28:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359863#M124568</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-22T07:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Daylight saving time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359864#M124569</link>
      <description>Hi&lt;BR /&gt;I change the locale into GMT+3:30...&lt;BR /&gt;The result is still -86400...&lt;BR /&gt;Does anyone encounter this issue before?&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro</description>
      <pubDate>Thu, 22 Mar 2012 07:35:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359864#M124569</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-22T07:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Daylight saving time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359865#M124570</link>
      <description>well, interesting indeed !&lt;BR /&gt;with locale GMT+3:30 =&amp;gt; result is 86400&lt;BR /&gt;with my normal locale =&amp;gt; result is -82800&lt;BR /&gt;but why ? and how could I workaround this problem though ?</description>
      <pubDate>Thu, 22 Mar 2012 07:43:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359865#M124570</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-22T07:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Daylight saving time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359866#M124571</link>
      <description>Hi all,&lt;BR /&gt;I still have this problem.&lt;BR /&gt;the solution could be to change the locale temporarily (for the time of job exec), to a locale that does not have any daylight saving time !&lt;BR /&gt;does somebody know whether this is possible ? for instance in a tJavaRow&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;laloune</description>
      <pubDate>Wed, 04 Apr 2012 16:21:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359866#M124571</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-04T16:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Daylight saving time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359867#M124572</link>
      <description>Is this a JAVA issue?</description>
      <pubDate>Wed, 04 Apr 2012 16:26:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359867#M124572</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2012-04-04T16:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Daylight saving time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359868#M124573</link>
      <description>well I do not know very well. It is a problem with locale (days 25th march 20112 is only 82800 minutes long (instead of 86400)&lt;BR /&gt;then when using the TalendDate.diffDate formula, it does not return correct result...</description>
      <pubDate>Wed, 04 Apr 2012 16:38:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359868#M124573</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-04T16:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Daylight saving time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359869#M124574</link>
      <description>Hi everybody, 
&lt;BR /&gt;finally found a workaround solution: I execute my job with the following JVM parameter: -Duser.timezone=UTC 
&lt;BR /&gt;no more dst problems then ! 
&lt;BR /&gt;thanks for your support though</description>
      <pubDate>Wed, 11 Apr 2012 10:01:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359869#M124574</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-11T10:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Daylight saving time</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359870#M124575</link>
      <description>Hi&lt;BR /&gt;Great! Thanks for your feedback.&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro</description>
      <pubDate>Wed, 11 Apr 2012 10:01:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Daylight-saving-time/m-p/2359870#M124575</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-11T10:01:49Z</dc:date>
    </item>
  </channel>
</rss>

