You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by James McMahon <js...@gmail.com> on 2022/10/03 20:28:54 UTC

Is result milliseconds since epoch?

I have a string representation of a datetime parsed from a lengthy
filename, attribute myValue with value of 20221003055959. If I convert to a
true datetime value and then apply toNumber() to that, does toNumber()
return milliseconds since the epoch? The expression language guide doesn’t
go into too much detail.
Thank you.

Re: Is result milliseconds since epoch?

Posted by Jo...@swisscom.com.
Yepp I would say it comes with milliseconds, but if you need it you can convert afterwards to seconds like in my example “${myDate:toDate("yyyy-MM-dd HH:mm:ss","UTC"):toNumber():divide(1000)}”

Cheers

From: James McMahon <js...@gmail.com>
Reply to: "users@nifi.apache.org" <us...@nifi.apache.org>
Date: Monday, 3 October 2022 at 22:30
To: users <us...@nifi.apache.org>
Subject: Is result milliseconds since epoch?

I have a string representation of a datetime parsed from a lengthy filename, attribute myValue with value of 20221003055959. If I convert to a true datetime value and then apply toNumber() to that, does toNumber() return milliseconds since the epoch? The expression language guide doesn’t go into too much detail.
Thank you.