dateFormat and dateArithmetic

NEWBIE HERE… Thanks for the assistance!

Date minus a day:
dateArithmetic(now(), -1, “day”)

Formatting the date
dateFormat(toDate(now()), “MMM d”)

Date minus a day plus formatting… which doesn’t work but can it?
dateArithmetic(dateFormat(toDate(now()), “MMM d”), -1, “day”)

I did figure out a way to do this by creating a expression tag, using dateArithmetic and format string, but interested if it’s possible to nest these to get where I want.

The reason your nested expression won’t work is that dateFormat() returns a string, and dateArithmetic() expects a Java Date as its first parameter. Try doing this:

dateFormat(dateArithmetic(now(), -1, "day"),"MMM d")

This works because dateArithmetic() returns a Java Date, which is what dateFormat needs as a first parameter.