Skip to content

Is there a way to work with dates/times as an integer in PL/SQL or Client (page) scripts — for example to get the difference in hours between two date/time values, similar to JavaScript's Date.getTime()? Subtracting two dates directly just returns another date.

Answer

Subtracting two Oracle DATE values returns a number of days by default (a fractional number when there's a time-of-day component, not another date) — multiply that difference by 24 to get hours (or by 1440 for minutes), rather than needing a JavaScript-style getTime() equivalent. Standard Oracle date-function references cover this kind of arithmetic in depth. If the calculation instead needs to respect IFS's own configured working-time calendars (skipping weekends and holidays) rather than plain calendar time, use the framework's Work Time Calendar API to calculate working-day differences or find the next valid working day, instead of raw date subtraction.

← Browse Developer Studio, deployment, and upgrades questions