Skip to main content
Gubbi
Gold ⭐️
April 2, 2020
Solved

How to derive yesterday's date using now expression

Currently i am using ${now():format("yyyyMMdd")} to extract today's date and passing it to next flow. But i would need Yesterday's and day before's date also in similar way. How can i achieve this.

Appreciate quick response on this.

stevenmatison
Platinum ⭐️⭐️
April 2, 2020

@Gubbi   The solution here is a now minute 24 hours:

 

Yesterday:

 

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

 

Day Before Yesterday:

 

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

1 reply

stevenmatison
Platinum ⭐️⭐️
April 2, 2020

@Gubbi   The solution here is a now minute 24 hours:

 

Yesterday:

 

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

 

Day Before Yesterday:

 

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

Translate