@ranie
I see a couple issues with your NiFi Expression Language (NEL) statement:
- I see some formatting issues in your java simple formatter string: 'yyyy-MM-dd\'T\'00:00:00\'Z\'. Your single and double quotes are not balanced.
- You are using the function "format ()" to change the timezone, but you could also use the "formatInstant()" function.
- You are missing the "toNumber()" function to convert the date string to a number before trying to apply a mathematically computation to it.
The Now() function will return the date current system time as the NiFi service sees it.
example: my NiFi server uses UTC timezone:
The toNumber() function will provide the current date and time as a number of milliseconds since midnight Jan 1st, 1970 GMT. This number will always be a GMT value.
The formatInstant() function will allow you to take a GMT time or a Java formatted date string and reformat it for a different timezone.
Taking above feedback into consideration, the following NEL statement should work for you.
${now():toNumber():minus(86400000):formatInstant("yyyy-MM-dd'T'HH:mm:ss 'Z'", "CET")}
Pay close attention to your use of single and double quotes.
Please help our community thrive. If you found any of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "Accept as Solution" on one or more of them that helped.
Thank you,
Matt