Open this example in the interactive library
Source code
const date = new Date("2026-12-31T12:00:00Z");
date.setUTCDate(date.getUTCDate() + 2);
console.log(date.toISOString());
Sample output
2027-01-02T12:00:00.000Z

Add UTC calendar days. A self-contained example using the JavaScript runtime.
Open this example in the interactive library
const date = new Date("2026-12-31T12:00:00Z");
date.setUTCDate(date.getUTCDate() + 2);
console.log(date.toISOString());
2027-01-02T12:00:00.000Z