[SOLVED] Time calculation yesterday

Hello,
I have aproblem during my time calculation.

here is my rule

var Calendar cal = Calendar::instance
  var DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd'T23:59:00'")
cal.add(Calendar::DAY_OF_YEAR, -1)
  var String yesterdayString = fmt.format(cal.time)
 logInfo("SetDay","yesterday is " + yesterdayString)

what is wrong??

I like to see now 2018-12-04T23:59:00 by today 5.12.2018 but sth. is not working.

thanks again

var String yesterday = now.minusDays(1).toString

You can add .format(xxx) but I am on my phone and I don’t have the syntax

Would bei great If you can Help me later

Instead of your rule, just a one liner:

var String yesterday = now.minusDays(1).toString("yyyy-MM-dd") + "T23:59:00"