<?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 Convert Double data type to Date in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Convert-Double-data-type-to-Date/m-p/2351161#M117872</link>
    <description>&lt;P&gt;Hi All,&lt;BR /&gt;I have a date written as double format in the source database (for example&amp;nbsp;42286,6144737963). In the destination database I need to convert it to Date format&amp;nbsp;yyyy-MM-dd HH:mm:ss. Can I do it in tMap? I tried&amp;nbsp;TalendDate.parseDate("yyyy-MM-dd HH:mm:ss", String.valueOf(row10.StartDATE )) but it returns an error&amp;nbsp;java.lang.NumberFormatException: For input string: "null".&lt;BR /&gt;Any help would be much appreciated &lt;IMG id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://yutwg22796.i.lithium.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Mar 2017 13:41:18 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-03-17T13:41:18Z</dc:date>
    <item>
      <title>Convert Double data type to Date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-Double-data-type-to-Date/m-p/2351161#M117872</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;I have a date written as double format in the source database (for example&amp;nbsp;42286,6144737963). In the destination database I need to convert it to Date format&amp;nbsp;yyyy-MM-dd HH:mm:ss. Can I do it in tMap? I tried&amp;nbsp;TalendDate.parseDate("yyyy-MM-dd HH:mm:ss", String.valueOf(row10.StartDATE )) but it returns an error&amp;nbsp;java.lang.NumberFormatException: For input string: "null".&lt;BR /&gt;Any help would be much appreciated &lt;IMG id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://yutwg22796.i.lithium.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 13:41:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-Double-data-type-to-Date/m-p/2351161#M117872</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-17T13:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Double data type to Date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-Double-data-type-to-Date/m-p/2351162#M117873</link>
      <description>First of all you have to get it clear how to interpret a Double value as Date. E.g. in Oracle and Excel the represents the integer part the days and the fraction the time. Of course the routine do you mentioned cannot do this because it expects a date formatted String, this is not what you have provided!
&lt;BR /&gt;Here is an example of a routine which converts a Double into a Date:
&lt;BR /&gt;
&lt;PRE&gt;public static Date getDuration(Double timeInExcel) {&lt;BR /&gt;    if (timeInExcel != null) {&lt;BR /&gt;        int wholeDays = (int) Math.floor(timeInExcel);&lt;BR /&gt;	int millisecondsInDay = (int) ((timeInExcel - wholeDays) * DAY_MILLISECONDS + 0.5);&lt;BR /&gt;	Calendar cal = Calendar.getInstance();&lt;BR /&gt;	cal.setTimeInMillis(0);&lt;BR /&gt;	cal.set(Calendar.DAY_OF_YEAR, wholeDays + 1);&lt;BR /&gt;	cal.set(Calendar.MILLISECOND, millisecondsInDay);&lt;BR /&gt;	return cal.getTime();&lt;BR /&gt;     } else {&lt;BR /&gt;	return null;&lt;BR /&gt;     }&lt;BR /&gt;}&lt;BR /&gt;&lt;/PRE&gt;
&lt;BR /&gt;This is a simple approach and I do not know in which way your Double value have to be interpreted as Date. This is the first question you have to ask!</description>
      <pubDate>Sat, 18 Mar 2017 14:52:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-Double-data-type-to-Date/m-p/2351162#M117873</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-18T14:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Double data type to Date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-Double-data-type-to-Date/m-p/2351163#M117874</link>
      <description>Thank you for your answer jlolling.
&lt;BR /&gt;I believe the double value is in Microsoft timestamp format. Example:&amp;nbsp;
&lt;A href="http://www.silisoftware.com/tools/date.php?inputdate=42286&amp;amp;inputformat=microsoft" target="_blank" rel="nofollow noopener noreferrer"&gt;http://www.silisoftware.com/tools/date.php?inputdate=42286&amp;amp;inputformat=microsoft&lt;/A&gt;</description>
      <pubDate>Mon, 20 Mar 2017 15:32:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-Double-data-type-to-Date/m-p/2351163#M117874</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-20T15:32:32Z</dc:date>
    </item>
  </channel>
</rss>

