Search code examples
apache-sparketlapache-nifi

NIFI expression for getting yesterday's date


I'm able to get the current timestamp using now() in NIFI. But I want to get the yesterday's timestamp in the below format and could not achieve it. what expression should be given for getting yesterday's timestamp at NIFI processor.

Egg: "superDate":"2021-03-07 23:59:00"

Thanks in advance!


Solution

  • ${now():toNumber():minus(86400000):format('yyyy-MM-dd HH:mm:ss')}