I have a problem when I try to subtract a day from a DateTime variable.
I have a variable, let’s call it “Original_Date” which is equal to “01/07/2021” and has the dd/MM/yyyy format.
I then want to subtract a day from the variable Original_Date, by using: Original_date.addDays(-1).toString(“dd/MM/yyy”)
and save it as the variable “New_Date”
The dateTime variable New_Date should then be “30/07/2021”. Now it returns “01/06/2021”, which is wrong.
It subtracts a number of the month, and not the days as it should.
Can someone help me out? Thanks!