Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to write Java timestamps out to a JSON object using tWriteJSONField, and not getting very far.
Not setting the type attribute yields the timestamp in a quoted string (E.g., "1531434936872")
Setting the type attribute to "integer" yields a NumberFormatException
Setting the type attribute to "number" turns the timestamp into a double (E.g., 1.531434846295E12)
Setting the type attribute to "object" yields an empty object ("{}")
Is there a way to handle this?
Hello,
Could you please elaborate your case with an example with input and expected output values?
Best regards
Sabrina
Given this simple job:
Where the row generator queries the current system time like this
And the JSON tree in tWriteJSONField is configured like this:
I get the following output:
Starting job TestJavaTimestamp at 09:18 16/07/2018. [statistics] connecting to socket on port 3627 [statistics] connected {"currentTime":1.531757903116E12} [statistics] disconnected Job TestJavaTimestamp ended at 09:18 16/07/2018. [exit code=0]
I would expect output like this:
{"currentTime":1531757892465}