Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Change timestamp format micro to millis on NiFi

avatar
Explorer

I get a file with multiple dates in the following format: 2021-08-25T12:34:48.984704 which is in micro format. How could I change these dates on the nifi to stay in millis? I tried the following: Apache Nifi Expression Language - toDate formatting formatting but I was not successful in the configuration. I believe that the answer is cohort, but I am not managing to make it work.

1 ACCEPTED SOLUTION

avatar
Explorer

I managed to solve it, I used ${field.value:substring(0,23):toDate("yyyy-MM-dd'T'HH:mm:ss.SSS"):format("yyyy-MM-dd HH:mm: ss.SSS")}

View solution in original post

1 REPLY 1

avatar
Explorer

I managed to solve it, I used ${field.value:substring(0,23):toDate("yyyy-MM-dd'T'HH:mm:ss.SSS"):format("yyyy-MM-dd HH:mm: ss.SSS")}