<?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 TalendDate.setDate: impossible to set minutes ? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/TalendDate-setDate-impossible-to-set-minutes/m-p/2372404#M135246</link>
    <description>Hi everybody,
&lt;BR /&gt;I try to use the TalendDate.setDate function. It works fine with the following statement:
&lt;BR /&gt;tmpDate = TalendDate.setDate(context.CurEndDate, 0, "HH");
&lt;BR /&gt;It sets the hour to 00
&lt;BR /&gt;but when I want to set the minutes to 00:
&lt;BR /&gt;tmpDate = TalendDate.setDate(context.CurEndDate, 0, "mm");
&lt;BR /&gt;it says :
&lt;BR /&gt;java.lang.RuntimeException: Can't support the dateType: mm
&lt;BR /&gt;Why can't we set minutes using this function ?
&lt;BR /&gt;And how can I work this around to set my date to midnight (for instance: 2012-04-03 12:00 becomes 2012-04-03 00:00)
&lt;BR /&gt;thanks in advance!</description>
    <pubDate>Tue, 03 Apr 2012 10:36:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-04-03T10:36:55Z</dc:date>
    <item>
      <title>TalendDate.setDate: impossible to set minutes ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TalendDate-setDate-impossible-to-set-minutes/m-p/2372404#M135246</link>
      <description>Hi everybody,
&lt;BR /&gt;I try to use the TalendDate.setDate function. It works fine with the following statement:
&lt;BR /&gt;tmpDate = TalendDate.setDate(context.CurEndDate, 0, "HH");
&lt;BR /&gt;It sets the hour to 00
&lt;BR /&gt;but when I want to set the minutes to 00:
&lt;BR /&gt;tmpDate = TalendDate.setDate(context.CurEndDate, 0, "mm");
&lt;BR /&gt;it says :
&lt;BR /&gt;java.lang.RuntimeException: Can't support the dateType: mm
&lt;BR /&gt;Why can't we set minutes using this function ?
&lt;BR /&gt;And how can I work this around to set my date to midnight (for instance: 2012-04-03 12:00 becomes 2012-04-03 00:00)
&lt;BR /&gt;thanks in advance!</description>
      <pubDate>Tue, 03 Apr 2012 10:36:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TalendDate-setDate-impossible-to-set-minutes/m-p/2372404#M135246</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-03T10:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: TalendDate.setDate: impossible to set minutes ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TalendDate-setDate-impossible-to-set-minutes/m-p/2372405#M135247</link>
      <description>well, an idea (not the best one for sure):
&lt;BR /&gt;Date tmpDate;
&lt;BR /&gt;String stmpDate;
&lt;BR /&gt;tmpDate=context.CurEndDate;
&lt;BR /&gt;// convert to string with yyyy-MM-dd format
&lt;BR /&gt;stmpDate = TalendDate.formatDate("yyyy-MM-dd", tmpDate);
&lt;BR /&gt;// concat with time to midnight
&lt;BR /&gt;stmpDate = stmpDate + " 00:00";
&lt;BR /&gt;// parse to Date with format yyyy-MM-dd HH:mm
&lt;BR /&gt;tmpDate=TalendDate.parseDate("yyyy-MM-dd HH:mm", stmpDate);
&lt;BR /&gt;it returns the date set to midnight</description>
      <pubDate>Tue, 03 Apr 2012 10:54:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TalendDate-setDate-impossible-to-set-minutes/m-p/2372405#M135247</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-03T10:54:40Z</dc:date>
    </item>
  </channel>
</rss>

