Open this example in the interactive library
Source code
const start = Date.parse("2026-10-22T09:00:00Z"),
end = Date.parse("2026-10-22T12:30:00Z");
console.log((end - start) / 3600000);
Sample output
3.5

Calculate elapsed hours. A self-contained example using the JavaScript runtime.
Open this example in the interactive library
const start = Date.parse("2026-10-22T09:00:00Z"),
end = Date.parse("2026-10-22T12:30:00Z");
console.log((end - start) / 3600000);
3.5