Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 09-08-2016 08:26 PM
Hello,
I'm currently converting csv files into avro and I'd like to store the date time stamps as unix (milliseconds). Is there a way to go about this in NiFi?
Thanks.
Created 09-08-2016 09:00 PM
@Harry Yuen your going to want to use "toNumber" in the NiFi expression Language. More information can be found here: https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#tonumber
Basically on your DateTime you'll want to cast:
${now():toNumber()}This will output the UnixEpoch time.
Created 09-08-2016 09:00 PM
@Harry Yuen your going to want to use "toNumber" in the NiFi expression Language. More information can be found here: https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#tonumber
Basically on your DateTime you'll want to cast:
${now():toNumber()}This will output the UnixEpoch time.
Created 09-08-2016 11:16 PM
@Devin Pinkston is correct. If you were to convert a date string, you would have had to add also the input date format, for example:
${now():toNumber():format('yyyy-MM-dd')}