<?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: Convert Excel Date in Java Date in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Convert-Excel-Date-in-Java-Date/m-p/2207968#M7396</link>
    <description>Thank you, it's resolve my problem, but I don't understand why 
&lt;BR /&gt;"java.util.GregorianCalenadr cannot be resolved"
&lt;BR /&gt;Max</description>
    <pubDate>Thu, 30 Oct 2008 15:50:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-10-30T15:50:21Z</dc:date>
    <item>
      <title>Convert Excel Date in Java Date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-Excel-Date-in-Java-Date/m-p/2207966#M7394</link>
      <description>Hi,&lt;BR /&gt;I try to convert Excel date in Var of tMap.&lt;BR /&gt;The code of var is the follow:&lt;BR /&gt;java.util.GregorianCalendar(1900, java.util.Calendar.JANUARY,1).add(java.util.Calendar.DATE, java.lang.Integer.parseInt(row3.DeliveryAttributSetDate)-1).&lt;BR /&gt;When I execute the followinf error appeare:&lt;BR /&gt;Exception in thread "main" java.lang.Error: Unresolved compilation problem: &lt;BR /&gt;	java.util cannot be resolved to a type&lt;BR /&gt;	at projectName.testconvertexceldate_0_1.testConvertExcelDate.tFileInputExcel_1Process(testConvertExcelDate.java:5445)&lt;BR /&gt;	at projectName.testconvertexceldate_0_1.testConvertExcelDate.runJobInTOS(testConvertExcelDate.java:5959)&lt;BR /&gt;	at projectName.testconvertexceldate_0_1.testConvertExcelDate.main(testConvertExcelDate.java:5848)&lt;BR /&gt;You are welcome if you have a good idea&lt;BR /&gt;Max</description>
      <pubDate>Sat, 16 Nov 2024 14:10:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-Excel-Date-in-Java-Date/m-p/2207966#M7394</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T14:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Excel Date in Java Date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-Excel-Date-in-Java-Date/m-p/2207967#M7395</link>
      <description>Hello,&lt;BR /&gt;What format is your Excel date?&lt;BR /&gt;With the TalendDate.parseDate() function you should be able to convert your date.&lt;BR /&gt;&lt;BR /&gt;José</description>
      <pubDate>Thu, 30 Oct 2008 14:16:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-Excel-Date-in-Java-Date/m-p/2207967#M7395</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-10-30T14:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Excel Date in Java Date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-Excel-Date-in-Java-Date/m-p/2207968#M7396</link>
      <description>Thank you, it's resolve my problem, but I don't understand why 
&lt;BR /&gt;"java.util.GregorianCalenadr cannot be resolved"
&lt;BR /&gt;Max</description>
      <pubDate>Thu, 30 Oct 2008 15:50:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-Excel-Date-in-Java-Date/m-p/2207968#M7396</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-10-30T15:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Excel Date in Java Date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-Excel-Date-in-Java-Date/m-p/2207969#M7397</link>
      <description>Hello, &lt;BR /&gt;I think that your var was missing a "new" declaration.</description>
      <pubDate>Fri, 31 Oct 2008 18:48:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-Excel-Date-in-Java-Date/m-p/2207969#M7397</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-10-31T18:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Excel Date in Java Date</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-Excel-Date-in-Java-Date/m-p/2207970#M7398</link>
      <description>I am still working on a better way myself but in the mean time try this: 
&lt;BR /&gt; 
&lt;PRE&gt;    /**&lt;BR /&gt;     * ExcelDateParse: Parses a Java Date from an Excel Date Format&lt;BR /&gt;     * {talendTypes} String&lt;BR /&gt;     * {Category} User Defined&lt;BR /&gt;     * {param} int(date) input: the excel date int to convert&lt;BR /&gt;     * {example} ExcelDateParse(38838) # result: Tue May 02 00:00:00 PDT 2006&lt;BR /&gt;     */    &lt;BR /&gt;    public static Date ExcelDateParse(int ExcelDate){&lt;BR /&gt;        Date result = null;&lt;BR /&gt;        try{&lt;BR /&gt;            GregorianCalendar gc = new GregorianCalendar(1900, Calendar.JANUARY, 1);&lt;BR /&gt;            gc.add(Calendar.DATE, ExcelDate - 1);&lt;BR /&gt;            result = gc.getTime();&lt;BR /&gt;        } catch(RuntimeException e1) {}&lt;BR /&gt;        return result;&lt;BR /&gt;    }&lt;BR /&gt;    &lt;BR /&gt;    /**&lt;BR /&gt;     * ExcelTimeParse: Parses a Java Time String from an Excel Formated Time &lt;BR /&gt;     * {talendTypes} String&lt;BR /&gt;     * {Category} User Defined&lt;BR /&gt;     * {param} String(date) input: the excel time String to convert&lt;BR /&gt;     * {example} ExcelTimeParse("0.6549") # result: 15:43:03 PM&lt;BR /&gt;     */    &lt;BR /&gt;    public static String ExcelTimeParse(String ExcelDate){&lt;BR /&gt;        String result = "";&lt;BR /&gt;        try{&lt;BR /&gt;            DateFormat format = new SimpleDateFormat("HH:mm:ss a");&lt;BR /&gt;            format.setTimeZone(TimeZone.getTimeZone("UTC"));&lt;BR /&gt;            double frac = Double.parseDouble(ExcelDate);&lt;BR /&gt;            long day = (long) Math.floor(frac);&lt;BR /&gt;            frac = frac - day;&lt;BR /&gt;            Date time = new Date((long) ( 86400000l * frac));&lt;BR /&gt;            result =  format.format(time);            &lt;BR /&gt;        } catch(RuntimeException e1) {}&lt;BR /&gt;        return result;&lt;BR /&gt;    }&lt;BR /&gt;// this next one is a Work in progress and not functional:&lt;BR /&gt;    /**&lt;BR /&gt;     * ExcelTimeParse: Parses a Java Time String from an Excel Formated Time &lt;BR /&gt;     * {talendTypes} String&lt;BR /&gt;     * {Category} User Defined&lt;BR /&gt;     * {param} String(date) input: the excel time String to convert&lt;BR /&gt;     * {example} ExcelTimeParse("38838.6549") # result: Tue May 02 15:43:03 PM&lt;BR /&gt;     */    &lt;BR /&gt;    public static String ExcelDateTimeParse(String ExcelDateTime, String DateFormat){&lt;BR /&gt;        String DefaultFormat = "MM/dd/yyyy HH:mm:ss a";&lt;BR /&gt;        String result = "";&lt;BR /&gt;        &lt;BR /&gt;        if(DateFormat.isEmpty()){&lt;BR /&gt;            DateFormat = DefaultFormat;&lt;BR /&gt;        }&lt;BR /&gt;        &lt;BR /&gt;        try{&lt;BR /&gt;            DateFormat format = new SimpleDateFormat(DateFormat);&lt;BR /&gt;            format.setTimeZone(TimeZone.getTimeZone("UTC"));&lt;BR /&gt;            double frac = Double.parseDouble(ExcelDateTime);&lt;BR /&gt;            long day = (long) Math.floor(frac);&lt;BR /&gt;            frac = frac - day;&lt;BR /&gt;            Date time = new Date((long) ( 86400000l * frac));&lt;BR /&gt;            result =  format.format(time);            &lt;BR /&gt;        } catch(RuntimeException e1) {}&lt;BR /&gt;        return result;&lt;BR /&gt;    }&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Oct 2012 18:06:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-Excel-Date-in-Java-Date/m-p/2207970#M7398</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-29T18:06:12Z</dc:date>
    </item>
  </channel>
</rss>

