This is a good example for why it's a bad idea to try to copy&paste your way to a JavaScript solution without a good background in how JavaScript works:
Joel's code assumed that you already had a variable (of type Date) named "previousDate". If that's the case, then this one line would add 36 hours. This would not get the previous date, and it would not set your current field to the result of that operation. You need to add more code around that one statement to come up with a solution that works for you. We cannot teach you JavaScript, that is something that you need to learn on your own. Take a look here for some guidance about how to get started: Learning to Program JavaScript for Adobe Acrobat - KHKonsulting LLC
You need to be able to take something like Joel's answer and then build your own script around that. And for that, you need a good understanding of JavaScript.
Did you add Joel's library to your form? The solution he presented will not work without that library.
The following code should work by getting the date from a field named "Date1", and then calculating the value for another field:
// get the date from the field "Date1"
var dateString = this.getField("Date1").value;
if (dateString != "") {
var previousDate = util.scand("m/d/yyyy h:MM tt", dateString);
previousDate.changeBy({"hours": 36});
event.value = util.printd("m/d/yyyy h:MM tt", previousDate);
}
else {
event.value = "";
}
You need to adjust this to fit your specific form and field formats. If you have a problem with what certain JavaScript methods do, (e.g. util.scand() or util.printd()), look them up in the Acrobat JavaScript API documentation: Acrobat DC SDK Documentation