Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

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

New Contributor

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

Like below:

110246-1565319679857.png to 110286-1565319711365.png




1 REPLY 1

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

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.