You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Christopher Wilson <wi...@gmail.com> on 2016/01/20 21:51:52 UTC

Unix epoch time to string issue

I'm working with a JSON formatted flowfile that contains a Unix epoch time,
which I pull out time and assign it to an attribute.

1. When I use AttributesToJSON and then attempt to InvokeHTTP to POST that
information I find that the time is now a string formatted as
'1.234567E9'.
2. If I attempt to insert an ExecuteStreamCommand to convert the string to
a float I'm getting an error that Nifi is sending that time variable down
as a float.
3. toNumber() doesn't like the scientific notation either, so none of the
builtiin functions work for me.

Thoughts?

Also, a little consistency with numeric formats and just 'do what I say'
with them.  If I want conversion I'll come back on another thread.

Thanks in advance.

Chris

Re: Unix epoch time to string issue

Posted by Joe Percivall <jo...@yahoo.com>.
Hello Chris,
Sorry no one has gotten back to you earlier but are you still having trouble with this?
If so, do you know where its getting reformatted from Unix epoch time to scientific notation? That may coincide with how are you extracting the value into an attribute to begin with.
Joe- - - - - - Joseph Percivalllinkedin.com/in/Percivalle: joepercivall@yahoo.com
 

    On Wednesday, January 20, 2016 3:51 PM, Christopher Wilson <wi...@gmail.com> wrote:
 

 I'm working with a JSON formatted flowfile that contains a Unix epoch time, which I pull out time and assign it to an attribute.  

1. When I use AttributesToJSON and then attempt to InvokeHTTP to POST that information I find that the time is now a string formatted as '1.234567E9'.  
2. If I attempt to insert an ExecuteStreamCommand to convert the string to a float I'm getting an error that Nifi is sending that time variable down as a float.
3. toNumber() doesn't like the scientific notation either, so none of the builtiin functions work for me.

Thoughts?

Also, a little consistency with numeric formats and just 'do what I say' with them.  If I want conversion I'll come back on another thread.

Thanks in advance.

Chris