<?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 Adding dates in tMap in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Adding-dates-in-tMap/m-p/2206215#M6368</link>
    <description>Hi, 
&lt;BR /&gt;I hope this is an easy question for someone. 
&lt;BR /&gt;I want to add two dates in a tMap. I thought that the following expression would work as both are date type fields: 
&lt;BR /&gt;row1.date + row2.date 
&lt;BR /&gt;Note that both rows are date/time data with the date pattern "dd-MM-yyyy HH:mm:ss" applied. For example 
&lt;BR /&gt;row1.date: 1900-01-00 00:15:00 
&lt;BR /&gt;row2.date: 2012-06-30 00:00:00 
&lt;BR /&gt;so the expected result would be: 2012-06-30 00:15:00 
&lt;BR /&gt; 
&lt;BR /&gt;thanks, 
&lt;BR /&gt;David</description>
    <pubDate>Sat, 30 Jun 2012 23:17:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-06-30T23:17:20Z</dc:date>
    <item>
      <title>Adding dates in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-dates-in-tMap/m-p/2206215#M6368</link>
      <description>Hi, 
&lt;BR /&gt;I hope this is an easy question for someone. 
&lt;BR /&gt;I want to add two dates in a tMap. I thought that the following expression would work as both are date type fields: 
&lt;BR /&gt;row1.date + row2.date 
&lt;BR /&gt;Note that both rows are date/time data with the date pattern "dd-MM-yyyy HH:mm:ss" applied. For example 
&lt;BR /&gt;row1.date: 1900-01-00 00:15:00 
&lt;BR /&gt;row2.date: 2012-06-30 00:00:00 
&lt;BR /&gt;so the expected result would be: 2012-06-30 00:15:00 
&lt;BR /&gt; 
&lt;BR /&gt;thanks, 
&lt;BR /&gt;David</description>
      <pubDate>Sat, 30 Jun 2012 23:17:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-dates-in-tMap/m-p/2206215#M6368</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-30T23:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Adding dates in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-dates-in-tMap/m-p/2206216#M6369</link>
      <description>Hi David 
&lt;BR /&gt;The expression in tMap. 
&lt;BR /&gt; 
&lt;PRE&gt;TalendDate.parseDate("yyyy-MM-dd H:mm:s",(TalendDate.getPartOfDate("YEAR",row2.date)+"-"+&lt;BR /&gt;(TalendDate.getPartOfDate("MONTH",row2.date)+1)+"-"+ &lt;BR /&gt;TalendDate.getPartOfDate("DAY_OF_MONTH",row2.date)+" "&lt;BR /&gt;+TalendDate.getPartOfDate("HOUR",row1.date)+":"+TalendDate.getPartOfDate("MINUTE",row1.date)+":"+TalendDate.getPartOfDate("SECOND",row1.date)))&lt;/PRE&gt; 
&lt;BR /&gt;The date pattern of this output column should be yyyy-MM-dd HH:mm:ss. 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Pedro</description>
      <pubDate>Mon, 02 Jul 2012 07:06:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-dates-in-tMap/m-p/2206216#M6369</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-07-02T07:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Adding dates in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-dates-in-tMap/m-p/2206217#M6370</link>
      <description>Pedro, 
&lt;BR /&gt;thank you for your answer. Your solution is working for me. 
&lt;BR /&gt;Thanks again, 
&lt;BR /&gt;David</description>
      <pubDate>Thu, 05 Jul 2012 21:57:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-dates-in-tMap/m-p/2206217#M6370</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-07-05T21:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Adding dates in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-dates-in-tMap/m-p/2206218#M6371</link>
      <description>Hi Pedro, 
&lt;BR /&gt;Your solution was working but my result is not in 24 hour time, but in 12 hour time. On other words, I am expecting a result of "2012-03-17 23:30:00" but I get "2012-03-17 11:30:00" 
&lt;BR /&gt;I have used the expression that you provided exactly. All of the date patterns are "yyyy-MM-dd HH:mm:ss". I have also checked the both the row inputs (with tLogRow) to the expression and these are in the correct format. Any ideas why? 
&lt;BR /&gt;Thanks in advance, 
&lt;BR /&gt;David</description>
      <pubDate>Sun, 08 Jul 2012 05:54:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-dates-in-tMap/m-p/2206218#M6371</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-07-08T05:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Adding dates in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-dates-in-tMap/m-p/2206219#M6372</link>
      <description>Hi David 
&lt;BR /&gt;First, you have to create a custom routine. 
&lt;BR /&gt; 
&lt;PRE&gt;public class HOUR_OF_DAY {&lt;BR /&gt;   &lt;BR /&gt;    	 public static int getPartOfDate(String partName, Date date) {&lt;BR /&gt;    	        if (partName == null || date == null)&lt;BR /&gt;    	            return 0;&lt;BR /&gt;    	        int ret = 0;&lt;BR /&gt;    	        String[] fieldsName = {  "HOUR_OF_DAY"};&lt;BR /&gt;    	        java.util.List&amp;lt;String&amp;gt; filedsList = java.util.Arrays.asList(fieldsName);&lt;BR /&gt;    	        Calendar c = Calendar.getInstance();&lt;BR /&gt;    	        c.setTime(date);&lt;BR /&gt;    	        switch (filedsList.indexOf(partName)) {&lt;BR /&gt;    	        case 0:&lt;BR /&gt;    	            ret = c.get(Calendar.HOUR_OF_DAY);&lt;BR /&gt;    	            break;&lt;BR /&gt;    	        default:&lt;BR /&gt;    	            break;&lt;BR /&gt;    	        }&lt;BR /&gt;    	        return ret;&lt;BR /&gt;    	    }&lt;BR /&gt;    }&lt;/PRE&gt; 
&lt;BR /&gt;Then use the following expression. 
&lt;BR /&gt; 
&lt;PRE&gt;TalendDate.parseDate("yyyy-MM-dd H:m:s",(TalendDate.getPartOfDate("YEAR",row2.date)+"-"+&lt;BR /&gt;(TalendDate.getPartOfDate("MONTH",row2.date)+1)+"-"+ &lt;BR /&gt;TalendDate.getPartOfDate("DAY_OF_MONTH",row2.date)+" "&lt;BR /&gt;+HOUR_OF_DAY.getPartOfDate("HOUR_OF_DAY",row1.date) +":"+TalendDate.getPartOfDate("MINUTE",row1.date)+":"+TalendDate.getPartOfDate("SECOND",row1.date)))&lt;/PRE&gt; 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Pedro</description>
      <pubDate>Mon, 09 Jul 2012 05:51:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-dates-in-tMap/m-p/2206219#M6372</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-07-09T05:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Adding dates in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-dates-in-tMap/m-p/2206220#M6373</link>
      <description>Pedro,
&lt;BR /&gt;thanks for your solution - it is working great! 
&lt;BR /&gt;Regards,
&lt;BR /&gt;David</description>
      <pubDate>Sun, 15 Jul 2012 01:57:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-dates-in-tMap/m-p/2206220#M6373</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-07-15T01:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: Adding dates in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-dates-in-tMap/m-p/2206221#M6374</link>
      <description>Hi&lt;BR /&gt;Glad to help you.&lt;BR /&gt;Feel free to ask any question here.&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro</description>
      <pubDate>Mon, 16 Jul 2012 02:59:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-dates-in-tMap/m-p/2206221#M6374</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-07-16T02:59:53Z</dc:date>
    </item>
  </channel>
</rss>

