Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Please see the Cloudera blog for information on the Cloudera Response to CVE-2021-4428

How to convert "file.creationtime" to timestamp format?

Explorer

Is there some way to convert "file.creationtime" format to timestamp format?

Like below:

110246-1565319679857.png to 110286-1565319711365.png




1 REPLY 1

Super Guru

@Raymond Cui

Try with adding new attribute in UpdateAttribute processor as


epochtime

${file.creationTime:toDate("yyyy-MM-dd'T'HH:mm:ss+0000"):toNumber()}

Then nifi will match the format and convert to epoch time.