[ 
https://issues.apache.org/jira/browse/NIFI-7230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17052468#comment-17052468
 ] 

Pierre Villard commented on NIFI-7230:
--------------------------------------

Hi [~Aleksei_Litsov] - yes it's still relevant. I think there are few options 
to tackle the problem here:
 * create a new EL function that would directly convert to a timestamp and 
allow multiple precisions as a parameter (seconds, milliseconds, microseconds, 
nanoseconds). Something like:

{code:java}
${ts:toTimestamp(<format>, <timezone>, <precision>)} {code}
 * change the existing functions to get rid of the Date object and use the new 
objects that came with Java 8 (Instant & co)

The first option is probably the easiest to implement. The second one is 
existing code and might be harder to do.

I'm open to different ideas though! And others probably have much better ideas.

> Improve EL to support microseconds/nanoseconds precision
> --------------------------------------------------------
>
>                 Key: NIFI-7230
>                 URL: https://issues.apache.org/jira/browse/NIFI-7230
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core Framework
>            Reporter: Pierre Villard
>            Priority: Major
>
> Using the EL, there is no way to convert a date like "2020-02-26 
> 20:23:53.439134" into its numerical representation (timestamp with 
> microsecond/nanosecond precision).
> At the moment, if trying to do:
>  
> {code:java}
> ${ts:toDate("yyyy-MM-dd HH:mm:ss.SSSSSS"):toNumber()} 
> {code}
> It'll give a timestamp with milliseconds precision.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to