<?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>question Re: Nifi problem with daylight saving in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-problem-with-daylight-saving/m-p/141708#M32098</link>
    <description>&lt;P&gt;I received the same date (perhaps I did something wrong &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ).&lt;/P&gt;&lt;P&gt;I solved the problem with the following UpdateAttribute:&lt;/P&gt;&lt;PRE&gt;${date:toDate("yyyy-MM-dd"):toNumber():plus(86400000):format("yyyy-MM-dd"):append(${date:toDate("yyyy-MM-dd HH:mm:ss"):toNumber():format(" HH:mm:ss")})}
&lt;/PRE&gt;&lt;P&gt;It works, but I'm still not very happy with this solution.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jun 2016 20:22:12 GMT</pubDate>
    <dc:creator>marius_mueller</dc:creator>
    <dc:date>2016-06-20T20:22:12Z</dc:date>
    <item>
      <title>Nifi problem with daylight saving</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-problem-with-daylight-saving/m-p/141706#M32096</link>
      <description>&lt;P&gt;I need next day as attribute.&lt;/P&gt;&lt;P&gt;As I know, date manipulation by adding ms (e.g. ${now():toNumber():plus(86400000) ).&lt;/P&gt;&lt;P&gt;With this solution I have a problem with the daylight saving:&lt;/P&gt;&lt;P&gt;If date = "2016-10-29 12:00:00"&lt;/P&gt;&lt;PRE&gt;${date:toDate("yyyy-MM-dd HH:mm:ss"):toNumber():plus(86400000):format("yyyy-MM-dd HH:mm:ss")}&lt;/PRE&gt;&lt;P&gt;This code results: "2016-10-30 11:00:00"&lt;/P&gt;&lt;P&gt;I have built a pyhton solution, but I'm not realy happy with it:&lt;/P&gt;&lt;PRE&gt;import java.io
from org.apache.commons.io import IOUtils
from java.nio.charset import StandardCharsets
from org.apache.nifi.processor.io import StreamCallback
from datetime import datetime
from datetime import timedelta

flowFile = session.get()
if (flowFile != None):
  inDate = flowFile.getAttribute('inputDate')
  outputDateName = flowFile.getAttribute('output date attribute name')
  unit = flowFile.getAttribute('python timedelta unit')
  quantity = int(flowFile.getAttribute('quantity'))
  pythonDateFormat = flowFile.getAttribute('python date format')
  
  kwargs = {unit: quantity }
  outputDt = (datetime.strptime(inDate, pythonDateFormat) + timedelta(**kwargs)).strftime(pythonDateFormat)
  
  flowFile = session.putAttribute(flowFile, outputDateName, outputDt)
  session.transfer(flowFile, REL_SUCCESS)


&lt;/PRE&gt;&lt;P&gt;Exist another solution with the given Nifi Processors?&lt;/P&gt;&lt;P&gt;I'm using HDF 1.2.0.0.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 16:13:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-problem-with-daylight-saving/m-p/141706#M32096</guid>
      <dc:creator>marius_mueller</dc:creator>
      <dc:date>2016-06-16T16:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi problem with daylight saving</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-problem-with-daylight-saving/m-p/141707#M32097</link>
      <description>&lt;P&gt;According to the Nifi documentation, the timezone is embedded in the date information.  &lt;A href="https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#types" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#types&lt;/A&gt;&lt;/P&gt;&lt;P&gt;What if you included the timezone in your input and parsed with 'Z' in the format?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2016 07:29:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-problem-with-daylight-saving/m-p/141707#M32097</guid>
      <dc:creator>paul_boal</dc:creator>
      <dc:date>2016-06-17T07:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi problem with daylight saving</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-problem-with-daylight-saving/m-p/141708#M32098</link>
      <description>&lt;P&gt;I received the same date (perhaps I did something wrong &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ).&lt;/P&gt;&lt;P&gt;I solved the problem with the following UpdateAttribute:&lt;/P&gt;&lt;PRE&gt;${date:toDate("yyyy-MM-dd"):toNumber():plus(86400000):format("yyyy-MM-dd"):append(${date:toDate("yyyy-MM-dd HH:mm:ss"):toNumber():format(" HH:mm:ss")})}
&lt;/PRE&gt;&lt;P&gt;It works, but I'm still not very happy with this solution.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2016 20:22:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-problem-with-daylight-saving/m-p/141708#M32098</guid>
      <dc:creator>marius_mueller</dc:creator>
      <dc:date>2016-06-20T20:22:12Z</dc:date>
    </item>
  </channel>
</rss>

