<?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 Covert integer (DateKey) to Date (MM-dd-yyyy) in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Covert-integer-DateKey-to-Date-MM-dd-yyyy/m-p/2326972#M96396</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;How to convert integer to Date. For example I have 73049, ideally when convert this to date in Excel, it 12-31-2099. I tried new java.util.Date(&amp;lt;column_name&amp;gt;) but its giving as 12-31-1969.&lt;BR /&gt;Please guide me.&lt;BR /&gt;Thanks,&lt;BR /&gt;Bharath&lt;/P&gt;</description>
    <pubDate>Tue, 23 Aug 2016 15:23:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-08-23T15:23:55Z</dc:date>
    <item>
      <title>Covert integer (DateKey) to Date (MM-dd-yyyy)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Covert-integer-DateKey-to-Date-MM-dd-yyyy/m-p/2326972#M96396</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;How to convert integer to Date. For example I have 73049, ideally when convert this to date in Excel, it 12-31-2099. I tried new java.util.Date(&amp;lt;column_name&amp;gt;) but its giving as 12-31-1969.&lt;BR /&gt;Please guide me.&lt;BR /&gt;Thanks,&lt;BR /&gt;Bharath&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2016 15:23:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Covert-integer-DateKey-to-Date-MM-dd-yyyy/m-p/2326972#M96396</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-23T15:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Covert integer (DateKey) to Date (MM-dd-yyyy)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Covert-integer-DateKey-to-Date-MM-dd-yyyy/m-p/2326973#M96397</link>
      <description>&lt;FONT size="5"&gt;&lt;FONT face="Verdana," helvetica=""&gt;column_name&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;should represent the number of second from 1970-01-01 as a Long variable. This is not the case here.
&lt;BR /&gt;
&lt;BR /&gt;Regards,
&lt;BR /&gt;TRF</description>
      <pubDate>Tue, 23 Aug 2016 16:47:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Covert-integer-DateKey-to-Date-MM-dd-yyyy/m-p/2326973#M96397</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2016-08-23T16:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Covert integer (DateKey) to Date (MM-dd-yyyy)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Covert-integer-DateKey-to-Date-MM-dd-yyyy/m-p/2326974#M96398</link>
      <description>Hi&amp;nbsp;
&lt;BR /&gt;
&lt;BR /&gt;@TRF, can you elaborate more on this. I converted integer to long, but it didnt work. the exepcted output for Date key 73049 is 12-31-2099.
&lt;BR /&gt;
&lt;BR /&gt;Thanks,
&lt;BR /&gt;Bharath</description>
      <pubDate>Wed, 24 Aug 2016 01:28:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Covert-integer-DateKey-to-Date-MM-dd-yyyy/m-p/2326974#M96398</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-24T01:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Covert integer (DateKey) to Date (MM-dd-yyyy)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Covert-integer-DateKey-to-Date-MM-dd-yyyy/m-p/2326975#M96399</link>
      <description>In Excel, 73049 is the number of days between 1900-01-01 and 2099-12-31 (approx 200 years).&amp;nbsp; 
&lt;BR /&gt;As 
&lt;FONT size="5"&gt;&lt;FONT face="Verdana," helvetica=""&gt;Date(Long millisec)&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;expect a number of milliseconds from 1970-01-01, the result give you 1969-12-31 because your timezone is GMT -8 (or something like that because you're in India). 1970-01-01 + 73 seconds - 8 hours : that's it, you're in 1969! 
&lt;BR /&gt;So, replace the value you pass to the Date() method by column_name*24L*3600L*1000L (column_name must be a Long datatype variable).&amp;nbsp; 
&lt;BR /&gt;As expected, the result is 2170-01-01 (1970-01-01 + 200 years). 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;TRF</description>
      <pubDate>Wed, 24 Aug 2016 22:10:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Covert-integer-DateKey-to-Date-MM-dd-yyyy/m-p/2326975#M96399</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2016-08-24T22:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Covert integer (DateKey) to Date (MM-dd-yyyy)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Covert-integer-DateKey-to-Date-MM-dd-yyyy/m-p/2326976#M96400</link>
      <description>What TRF said about Excel is correct. Another solution to resolve this is below...&lt;BR /&gt;&lt;PRE&gt;Date myDate = routines.TalendDate.parseDate("yyyy-MM-dd", "1899-12-31");&lt;BR /&gt;myDate = routines.TalendDate.addDate(myDate, 73049, "dd");&lt;BR /&gt;&lt;BR /&gt;System.out.println(myDate);&lt;/PRE&gt;&lt;BR /&gt;&amp;nbsp;However, it will not take into account time.</description>
      <pubDate>Wed, 24 Aug 2016 22:47:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Covert-integer-DateKey-to-Date-MM-dd-yyyy/m-p/2326976#M96400</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-24T22:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: Covert integer (DateKey) to Date (MM-dd-yyyy)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Covert-integer-DateKey-to-Date-MM-dd-yyyy/m-p/2326977#M96401</link>
      <description>Thanks TRF and rhall. It worked</description>
      <pubDate>Thu, 25 Aug 2016 15:35:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Covert-integer-DateKey-to-Date-MM-dd-yyyy/m-p/2326977#M96401</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-25T15:35:08Z</dc:date>
    </item>
  </channel>
</rss>

