<?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 Now() Format in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-Now-Format/m-p/295581#M9739</link>
    <description>&lt;P&gt;Hello all, I'm new here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;wondered if any of you could help me. I am trying to create a flow in Nifi to stop any incorrect timestamps getting out of Nifi (i.e. to HDFS or Splunk).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to capture any epoch timestamp 24hours in the future or 7 days in the past. I have created a processor that takes all timestamp formats back to epoch (as attribute named 'timestamp'. I then want to minus the timestamp from 'now' then use the 'gt' and 'lt' functions to return a true/false against another attribute I have made called ,valid_timestamp'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first of all, can anyone help me minus my timestamp (value) from 'now'?&lt;/P&gt;&lt;PRE&gt;${now():toNumber():minus(&lt;EM&gt;timestamp(attibute value&lt;/EM&gt;))&lt;/PRE&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;I spent the whole day yesterday trying to get this to work.. I'm sure there is a more straight forward way to achieve what I am after, any advice would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ts.png" style="width: 915px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/27437i97AE5C423AAD12F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="ts.png" alt="ts.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;</description>
    <pubDate>Thu, 07 May 2020 08:09:52 GMT</pubDate>
    <dc:creator>Griggsy</dc:creator>
    <dc:date>2020-05-07T08:09:52Z</dc:date>
    <item>
      <title>Nifi Now() Format</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-Now-Format/m-p/96286#M9736</link>
      <description>&lt;P&gt;According to the docs ${now()} should yeild &lt;/P&gt;&lt;P&gt;"current date and time as the number of milliseconds since Midnight GMT on
	January 1, 1970."&lt;/P&gt;&lt;P&gt;Which sounds like a Unix epoch style timestamp in miliseconds &lt;/P&gt;&lt;P&gt;but what I actually receive is Fri Oct 30 02:36:08 UTC 2015&lt;/P&gt;&lt;P&gt;Does now() have options I am missing?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2026 12:34:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-Now-Format/m-p/96286#M9736</guid>
      <dc:creator>wsalazar</dc:creator>
      <dc:date>2026-04-21T12:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi Now() Format</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-Now-Format/m-p/96287#M9737</link>
      <description>&lt;P&gt;Wade, this is a documentation bug. The &lt;EM&gt;now()&lt;/EM&gt;&lt;B&gt; &lt;/B&gt;statement returns a Date object, not a long epoch, one more step required. E.g. consider this expression which gets 'yesterday':&lt;/P&gt;&lt;PRE&gt;${now():toNumber():minus(86400000):format('yyyy-MM-dd')} 
&lt;/PRE&gt;&lt;P&gt;You can follow &lt;A target="_blank" href="https://issues.apache.org/jira/browse/NIFI-1078"&gt;https://issues.apache.org/jira/browse/NIFI-1078&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2015 20:08:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-Now-Format/m-p/96287#M9737</guid>
      <dc:creator>andrewg</dc:creator>
      <dc:date>2015-10-30T20:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi Now() Format</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-Now-Format/m-p/96288#M9738</link>
      <description>&lt;P&gt;Thanks Andrew ${now();toNumber():Divide(1000)} got me what I needed.  &lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 04:24:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-Now-Format/m-p/96288#M9738</guid>
      <dc:creator>wsalazar</dc:creator>
      <dc:date>2015-11-04T04:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi Now() Format</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-Now-Format/m-p/295581#M9739</link>
      <description>&lt;P&gt;Hello all, I'm new here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;wondered if any of you could help me. I am trying to create a flow in Nifi to stop any incorrect timestamps getting out of Nifi (i.e. to HDFS or Splunk).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to capture any epoch timestamp 24hours in the future or 7 days in the past. I have created a processor that takes all timestamp formats back to epoch (as attribute named 'timestamp'. I then want to minus the timestamp from 'now' then use the 'gt' and 'lt' functions to return a true/false against another attribute I have made called ,valid_timestamp'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first of all, can anyone help me minus my timestamp (value) from 'now'?&lt;/P&gt;&lt;PRE&gt;${now():toNumber():minus(&lt;EM&gt;timestamp(attibute value&lt;/EM&gt;))&lt;/PRE&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;I spent the whole day yesterday trying to get this to work.. I'm sure there is a more straight forward way to achieve what I am after, any advice would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ts.png" style="width: 915px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/27437i97AE5C423AAD12F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="ts.png" alt="ts.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 08:09:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-Now-Format/m-p/295581#M9739</guid>
      <dc:creator>Griggsy</dc:creator>
      <dc:date>2020-05-07T08:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi Now() Format</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-Now-Format/m-p/295658#M9740</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/77674"&gt;@Griggsy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd strongly encourage you to start a new question rather then asking for help on an existing question with an already accepted solution.&amp;nbsp; You'll get better traction and visibility that way.&lt;BR /&gt;&lt;BR /&gt;Matt&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2020 19:11:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-Now-Format/m-p/295658#M9740</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2020-05-08T19:11:30Z</dc:date>
    </item>
  </channel>
</rss>

