<?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: How to parse an Excel date into a date in Data Quality</title>
    <link>https://community.qlik.com/t5/Data-Quality/How-to-parse-an-Excel-date-into-a-date/m-p/2487910#M4096</link>
    <description>&lt;P&gt;I answer to myself : in a tJavaRow&lt;/P&gt;
&lt;P&gt;Double excelDate = input_row.&amp;lt;my input value&amp;gt; ;&lt;BR /&gt;int days = (int) Math.floor(excelDate);&lt;BR /&gt;double fractionOfDay = excelDate - days;&lt;BR /&gt;String baseDateStr = "1899-12-30";&lt;BR /&gt;Date baseDate = TalendDate.parseDate("yyyy-MM-dd", baseDateStr);&lt;BR /&gt;Date finalDate = TalendDate.addDate(baseDate, days, "dd");&lt;BR /&gt;int hours = (int) (fractionOfDay * 24);&lt;BR /&gt;int minutes = (int) ((fractionOfDay * 24 - hours) * 60);&lt;BR /&gt;int seconds = (int) (((fractionOfDay * 24 - hours) * 60 - minutes) * 60);finalDate = TalendDate.addDate(finalDate, hours, "HH");&lt;BR /&gt;finalDate = TalendDate.addDate(finalDate, minutes, "mm");&lt;BR /&gt;finalDate = TalendDate.addDate(finalDate, seconds, "ss");&lt;/P&gt;
&lt;P&gt;output_row.&amp;lt;my column name&amp;gt;=finalDate;&lt;/P&gt;
&lt;P&gt;It's better than nothing, but it works.&lt;/P&gt;</description>
    <pubDate>Fri, 18 Oct 2024 12:57:07 GMT</pubDate>
    <dc:creator>fabienb1</dc:creator>
    <dc:date>2024-10-18T12:57:07Z</dc:date>
    <item>
      <title>How to parse an Excel date into a date</title>
      <link>https://community.qlik.com/t5/Data-Quality/How-to-parse-an-Excel-date-into-a-date/m-p/2487880#M4095</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I try to read an Excel file that has its dates stored as a double ; for example 41275.00 is 01/01/2013 ; or 45537.4080179398 is 02/09/2024 09:47:33&lt;/P&gt;
&lt;P&gt;How can I read that ? I can read it as a String, but I can't convert it to a date with TalendDate.parseDate(), and Talend does not support java.util.Date.&lt;/P&gt;
&lt;P&gt;I have found many issues realted to date formatting on this community, But none directly related to the specifically Excel format. Do not hesitate to tell me if I missed it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 10:17:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Quality/How-to-parse-an-Excel-date-into-a-date/m-p/2487880#M4095</guid>
      <dc:creator>fabienb1</dc:creator>
      <dc:date>2024-10-18T10:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse an Excel date into a date</title>
      <link>https://community.qlik.com/t5/Data-Quality/How-to-parse-an-Excel-date-into-a-date/m-p/2487910#M4096</link>
      <description>&lt;P&gt;I answer to myself : in a tJavaRow&lt;/P&gt;
&lt;P&gt;Double excelDate = input_row.&amp;lt;my input value&amp;gt; ;&lt;BR /&gt;int days = (int) Math.floor(excelDate);&lt;BR /&gt;double fractionOfDay = excelDate - days;&lt;BR /&gt;String baseDateStr = "1899-12-30";&lt;BR /&gt;Date baseDate = TalendDate.parseDate("yyyy-MM-dd", baseDateStr);&lt;BR /&gt;Date finalDate = TalendDate.addDate(baseDate, days, "dd");&lt;BR /&gt;int hours = (int) (fractionOfDay * 24);&lt;BR /&gt;int minutes = (int) ((fractionOfDay * 24 - hours) * 60);&lt;BR /&gt;int seconds = (int) (((fractionOfDay * 24 - hours) * 60 - minutes) * 60);finalDate = TalendDate.addDate(finalDate, hours, "HH");&lt;BR /&gt;finalDate = TalendDate.addDate(finalDate, minutes, "mm");&lt;BR /&gt;finalDate = TalendDate.addDate(finalDate, seconds, "ss");&lt;/P&gt;
&lt;P&gt;output_row.&amp;lt;my column name&amp;gt;=finalDate;&lt;/P&gt;
&lt;P&gt;It's better than nothing, but it works.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 12:57:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Quality/How-to-parse-an-Excel-date-into-a-date/m-p/2487910#M4096</guid>
      <dc:creator>fabienb1</dc:creator>
      <dc:date>2024-10-18T12:57:07Z</dc:date>
    </item>
  </channel>
</rss>

