Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Apache NiFi, how do I print current date in ISO format with timezone

I am using the now() function to add a dynamic attribute to the flow. The value that's assigned to the attribute is human-readable format. I would like to get the value in the ISO format:

2019-09-21T12:00:00Z

I have tried this expression:

${now():format("yyyy-MM-ddTHH:mm:ss.SSS'Z'")}

However, I am getting an error on 'T'.

 ERROR: failed to process session due to Illegal pattern character 'T'; 

Is there a quick way to format the date using the EL?

I am NiFi version 1.9.1

Thanks

like image 479
Vijay Kumar Avatar asked Oct 15 '25 15:10

Vijay Kumar


1 Answers

According to the documentation,

${now():format("yyyy-MM-dd'T'HH:mm:ss'Z'", "GMT")}

will give your expected result.

like image 69
Lamanus Avatar answered Oct 17 '25 23:10

Lamanus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!