I’ve been trying to add a custom action to a Zap (and then to do the same with custom code) and seem to be having an issue with dates/datetimes. I am simply attempting to add 12 months to a specific date in Javascript. My code works in *every other interface* that I test it in, but for some reason, the same code returns inaccurate outputs when I use Zapier custom code or custom actions. Code is here:
const numMonths = 12;
const unixStartDate = 1743179322; //March 28th, 2025 in unix - set dynamically in the eventual actionconst startDate = new Date(unixStartDate * 1000); //Convert unix to datetime
console.log('Start Date ::: '+startDate);const newEndDate = new Date(startDate.setMonth(startDate.getMonth() + numMonths)); //Add 12 months
console.log('End Date ::: '+newEndDate); //Would expect March 28th, 2026
This code runs correctly on other interfaces, but when I run it in Zapier, it returns the date Fri Sep 19 2042 -- 18 years ahead. I can find no other reasonable solution other than something is wrong on Zapier's side. Any help would be appreciated.





